Coweeta Hydrologic Laboratory Watershed 32 using Static, SSURGO, and RSS soil inputs.

The following R Markdown script prepares and runs the Regional Hydro-Ecologic Simulation System (RHESSYS) within the R environment. Modified from RHESSysIOinR example scripts created by Will Burke and Ryan Bart. Includes CLHS code snippets and SDA code from Dylan Beaudette.

Windows Subsystem via Linux must be installed before RHESSys will run in a Windows environment. GRASS8 must be installed to run the spatial preprocessing portion of the script.

Code has been modified to run RHESSys 7.4 and 5.18. 7.4 vegetation processing differs slightly from 5.18. Various template differences exist between the two versions of RHESSys and template files must be carefully reviewed if moving between versions. This script is currently set up to run RHESSys 7.4

knitr::opts_chunk$set(warning = FALSE, message = FALSE)
#install.packages("devtools")
#devtools::install_github("ropensci/FedData")

library(aqp)
## This is aqp 1.41
library(daymetr)
library(clhs)
## Registered S3 methods overwritten by 'tibble':
##   method     from  
##   format.tbl pillar
##   print.tbl  pillar
library(EcoHydRology)
## Loading required package: operators
## 
## Attaching package: 'operators'
## The following objects are masked from 'package:base':
## 
##     options, strrep
## Loading required package: topmodel
## Loading required package: DEoptim
## Loading required package: parallel
## 
## DEoptim package
## Differential Evolution algorithm in R
## Authors: D. Ardia, K. Mullen, B. Peterson and J. Ulrich
## Loading required package: XML
library(elevatr)
library(ezknitr)
library(FedData)
## 
## Attaching package: 'FedData'
## The following object is masked from 'package:operators':
## 
##     %>%
library(foreach)
library(foreign)
library(ggplot2)
library(ggpubr)
## 
## Attaching package: 'ggpubr'
## 
## The following object is masked from 'package:operators':
## 
##     %>%
library(hydroGOF)
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## 
## Attaching package: 'hydroGOF'
## The following object is masked from 'package:topmodel':
## 
##     NSeff
library(imputeTS)
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## 
## Attaching package: 'imputeTS'
## The following object is masked from 'package:zoo':
## 
##     na.locf
## The following object is masked from 'package:operators':
## 
##     %>%
library(knitr)
library(latticeExtra)
## Loading required package: lattice
## 
## Attaching package: 'latticeExtra'
## The following object is masked from 'package:ggplot2':
## 
##     layer
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
library(Metrics)
## 
## Attaching package: 'Metrics'
## The following objects are masked from 'package:hydroGOF':
## 
##     mae, mse, rmse
library(raster)
## Loading required package: sp
## 
## Attaching package: 'raster'
## The following objects are masked from 'package:aqp':
## 
##     metadata, metadata<-
library(rasterVis)
library(readxl)
library(reshape2)
library(rgdal)
## Please note that rgdal will be retired by the end of 2023,
## plan transition to sf/stars/terra functions using GDAL and PROJ
## at your earliest convenience.
## 
## rgdal: version: 1.5-32, (SVN revision 1176)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.4.1, released 2021/12/27
## Path to GDAL shared files: C:/Users/Carlos/Documents/R/win-library/4.0/rgdal/gdal
## GDAL binary built with GEOS: TRUE 
## Loaded PROJ runtime: Rel. 7.2.1, January 1st, 2021, [PJ_VERSION: 721]
## Path to PROJ shared files: C:/Users/Carlos/Documents/R/win-library/4.0/rgdal/proj
## PROJ CDN enabled: FALSE
## Linking to sp version:1.4-6
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
library(rgrass)
## GRASS GIS interface loaded with GRASS version: (GRASS not running)
library(rmarkdown)
library(Rmisc)
## Loading required package: plyr
## 
## Attaching package: 'plyr'
## The following object is masked from 'package:ggpubr':
## 
##     mutate
library(RHESSysPreprocessing)
library(RHESSysIOinR)
## 
## Attaching package: 'RHESSysIOinR'
## The following object is masked from 'package:RHESSysPreprocessing':
## 
##     read_world
library(sf)
## Linking to GEOS 3.9.1, GDAL 3.2.1, PROJ 7.2.1; sf_use_s2() is TRUE
## 
## Attaching package: 'sf'
## The following object is masked from 'package:operators':
## 
##     %>%
library(soilDB)
library(sp)
library(stats)
library(stringi)
library(tactile)
library(terra)
## terra 1.5.21
## 
## Attaching package: 'terra'
## The following object is masked from 'package:rgdal':
## 
##     project
## The following object is masked from 'package:knitr':
## 
##     spin
## The following object is masked from 'package:zoo':
## 
##     time<-
## The following object is masked from 'package:ggpubr':
## 
##     rotate
## The following object is masked from 'package:ggplot2':
## 
##     arrow
library(testthat)
## 
## Attaching package: 'testthat'
## The following object is masked from 'package:terra':
## 
##     describe
## The following object is masked from 'package:operators':
## 
##     %>%
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v tibble  3.0.3     v dplyr   1.0.5
## v tidyr   1.1.3     v stringr 1.4.0
## v readr   2.1.2     v forcats 0.5.1
## v purrr   0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x forcats::%>%()           masks stringr::%>%(), dplyr::%>%(), purrr::%>%(), tidyr::%>%(), tibble::%>%(), testthat::%>%(), sf::%>%(), imputeTS::%>%(), ggpubr::%>%(), FedData::%>%(), operators::%>%()
## x purrr::accumulate()      masks foreach::accumulate()
## x dplyr::arrange()         masks plyr::arrange()
## x terra::arrow()           masks ggplot2::arrow()
## x lubridate::as.difftime() masks base::as.difftime()
## x dplyr::combine()         masks aqp::combine()
## x purrr::compact()         masks plyr::compact()
## x dplyr::count()           masks plyr::count()
## x lubridate::date()        masks base::date()
## x readr::edition_get()     masks testthat::edition_get()
## x tidyr::extract()         masks terra::extract(), raster::extract()
## x dplyr::failwith()        masks plyr::failwith()
## x dplyr::filter()          masks stats::filter()
## x dplyr::id()              masks plyr::id()
## x terra::intersect()       masks raster::intersect(), lubridate::intersect(), base::intersect()
## x purrr::is_null()         masks testthat::is_null()
## x dplyr::lag()             masks stats::lag()
## x latticeExtra::layer()    masks ggplot2::layer()
## x readr::local_edition()   masks testthat::local_edition()
## x dplyr::matches()         masks tidyr::matches(), testthat::matches()
## x dplyr::mutate()          masks plyr::mutate(), ggpubr::mutate()
## x dplyr::rename()          masks plyr::rename()
## x dplyr::select()          masks raster::select()
## x lubridate::setdiff()     masks base::setdiff()
## x dplyr::slice()           masks aqp::slice()
## x dplyr::src()             masks terra::src()
## x dplyr::summarise()       masks plyr::summarise()
## x dplyr::summarize()       masks plyr::summarize()
## x terra::union()           masks raster::union(), lubridate::union(), base::union()
## x purrr::when()            masks foreach::when()
library(viridisLite)
library(dplyr)


setwd(system.file("extdata/", package = "RHESSysIOinR"))
 
rh_ver = dir(path = "modelfiles/rhessys/", pattern = "^rhessys\\d+",recursive = F)

getwd()
## [1] "C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata"
rh_path = file.path("modelfiles/rhessys", rh_ver)

## Load in necessary files
filedir <- ("C:/Users/Carlos/Documents/GitHub/RHESSys74-R-Markdown/")

watershedshapefile <- paste0(filedir, "input_files/shapefiles/watersheds/Coweeta_Hydrologic_Laboratory.shp")
streamshapefile<- paste0(filedir,"input_files/shapefiles/streams/StreamsCaldwellClipped.shp")
weirshapefile<- paste0(filedir,"input_files/shapefiles/weirs/Subbasinoutlets.shp")
roadshapefile <- paste0(filedir, "input_files/shapefiles/roads/UpdatedRoads4Reprojected32617.shp")

CWRG12 <- paste0(filedir,"input_files/precipitation/RDS-2017-0031/Data/RG12_daily_1942_2021.csv")
CWRG20 <-paste0(filedir,"input_files/precipitation/RDS-2017-0031/Data/RG20_daily_1962_2021.csv")

CS01 <- ("C:/Users/Carlos/Desktop/ORISE/Climate Data/CW/Air Temperature/CS01 OISHI/cs01_hourly_Tair_2011_2023.csv")
CS01LT<- ("C:/Users/Carlos/Desktop/ORISE/Climate Data/CW/Air Temperature/RDS-2015-0049/Data/cs01_daily_airtemp.csv")
CS21<- paste0(filedir,"input_files/temperature/RDS-2015-0042/Data/cs21_daily.csv")
CS28<- paste0(filedir,"input_files/temperature/RDS-2015-0042/Data/cs28_daily.csv")

newsmlocations<-  paste0(filedir,"input_files/shapefiles/soil_moisture/CoweetaNRCSsmKML.kml")

#in step 4

setwd(system.file("extdata/", package = "RHESSysIOinR"))
#Prepare observed Streamflow data


obsws32<- read.csv(paste0(filedir,"input_files/streamflow/Daily Streamflow Watershed 32/Daily Streamflow Watershed 32/ObservedWS32.csv"))


obsws32$Date<- as.Date(obsws32$Date)

Caldates<- read.csv("outputfilter/caldates.csv")
Valdates<- read.csv("outputfilter/valdates.csv")

Caldates<- Caldates[,2]
Valdates<- Valdates[,2]

mergedsm<- read.table("outputfilter/mergedsm.csv", header = T, sep = ",")
obsws32sm<- read.table("outputfilter/obsws32sm.csv", header = T, sep = ",")
obsws32sm$Date<- as.Date(obsws32sm$Date,"%Y-%m-%d")

New Patch Filter

Basin - Basin Hillslope - Subbasin Zone - Patch Patch - Patch

1 112 136557 1 110 141942 1 110 149478

setwd(system.file("extdata/", package = "RHESSysIOinR"))

patchfilterpatch1 = build_output_filter(timestep = "daily",
                                   output_format = "csv",
                                   output_path = "outputfilter",
                                   output_filename = "valws32patch1",
                                   spatial_level = "patch",
                                   spatial_ID = "1:112:136557:136557",
                                   variables = c("rootzone.S","rootzone.potential_sat","rootzone.field_capacity", "rz_storage"))

patchfilterpatch2 = build_output_filter(timestep = "daily",
                                   output_format = "csv",
                                   output_path = "outputfilter",
                                   output_filename = "valws32patch2",
                                   spatial_level = "patch",
                                   spatial_ID = "1:110:141942:141942",
                                   variables = c("rootzone.S","rootzone.potential_sat","rootzone.field_capacity", "rz_storage"))

patchfilterpatch3 = build_output_filter(timestep = "daily",
                                   output_format = "csv",
                                   output_path = "outputfilter",
                                   output_filename = "valws32patch3",
                                   spatial_level = "patch",
                                   spatial_ID = "1:110:149478:149478",
                                   variables = c("rootzone.S","rootzone.potential_sat","rootzone.field_capacity", "rz_storage"))


# start_time = Sys.time()
# start_time
# run_rhessys_single(input_rhessys = input_rhessys,
#                    hdr_files = input_hdr,
#                    tec_data = input_tec_data,
#                    cmd_pars = stdpars,
#                    output_filter = c(patchfilterpatch1,patchfilterpatch2,patchfilterpatch3),
#                    runID = 'single')
# end_time = Sys.time()
# end_time - start_time
# end_time

*** VALIDATION ***

Run Model once for validation, copied from previous code must clean up

Configure RHESSys Inputs/Outputs for a single run.

Use World Statefile created during spin-up. To run model one time at patch scale.

COMMAND LINE OPTIONS

-b Basin output option. Print out response variables for specified basins. -c Canopy stratum output option. Print out response variables for specified strata. -g Grow option. Try to read in dynamic bgc input data and output dynamic bgc parameters. -h Hillslope output option. Print out response variables for specified hillslopes. -p Patch output option. Print out response variables for specified patches. -r Routing option. Gives name of flow_table to define explicit routing connectivity. Also trigger use of explicit routing over TOPMODEL approach. -c Stratum output option. Print out response variables for specified strata.

patches listed top to bottom

setwd(system.file("extdata/", package = "RHESSysIOinR"))

input_rhessys = IOin_rhessys_input(
  version = rh_path,
  tec_file = "tecfiles/tec_daily",
  world_file = "CWWS32.world.Y2018M11D1H1.state.Y2018M11D1H1.state",
  world_hdr_prefix = "CWWS32",
  flowtable = "CWWS32.flow",
  start = "2013 11 1 1",
  end = "2018 11 1 1",
  output_folder = "out",
  output_prefix = "cwws32",
#  commandline_options = c("-b -g -p"))
 
 commandline_options = c("-b -g -p"))

#commandline_options = c("-b -g -p 1 110 136557 136557 -p 1 108 141942 141942 -p 1 108 149478 149478"))
#1 107 141942 136557
#1 107 149478 136557

## TEC file dictates model output, begin output a year in to allow model SM to stabilize
# do not output_state or worldfile may be overwritten as output is created
input_tec_data = IOin_tec_std(start = "2015 11 1 1",
                              end = "2018 11 1 1",
                              output_state = FALSE)

input_hdr = IOin_hdr(
  basin = "defs/basin.def",
  hillslope = "defs/hillslope.def",
  zone = "defs/zone.def",
  soil = c("defs/soil_clay.def","defs/soil_clayloam.def","defs/soil_loam.def","defs/soil_loamysand.def","defs/soil_rock.def","defs/soil_sand.def","defs/soil_sandyclay.def","defs/soil_sandyclayloam.def","defs/soil_sandyloam.def","defs/soil_silt.def","defs/soil_siltyclay.def","defs/soil_siltyclayloam.def","defs/soil_siltyloam.def","defs/soil_water.def", "defs/soil_shallowloam.def", "defs/soil_shallowsandyclayloam.def", "defs/soil_shallowsandyloam.def"),
  landuse = "defs/lu_undev.def",
  stratum = c("defs/veg_deciduous/veg_deciduous.def","defs/veg_evergreen/veg_evergreen.def","defs/veg_deciduous_BES.def","defs/veg_eucalypt.def","defs/veg_grass.def","defs/veg_lawn_2cm.def","defs/veg_lawn_5cm.def","defs/veg_lawn_10cm.def","defs/veg_nonveg.def"),
  basestations = "clim/cwtws32local.base")

## Calibrated Values 


stdpars<- IOin_cmd_pars(
            m = 1.581785,
            k = 41.12945,
            soil_dep= 0.1776117,
            m_v = 8.11574,
            k_v = 0.8713272,
            gw1 = 0.2477113,
            gw2 = 0.4291277,
            pa = 0.3913392,
            po = 1.85424,
            vgseng1 = 1.459184,
            vgseng2 = 1.799894,
            vgseng3 = 1.381696)

Run RHESSys once for validation

Read RHESSys Single Run Output

setwd(system.file("extdata/", package = "RHESSysIOinR"))
getwd()
## [1] "C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata"
singlerunvalidation<- readin_rhessys_output("out/cwws32_runvalidation")

plot(singlerunvalidation$bd$streamflow~singlerunvalidation$bd$date, type = "l", main = "Streamflow", xlab = "Date", ylab = "Streamflow", col = 'DarkBlue')

plot(as.Date(singlerunvalidation$bd$date),singlerunvalidation$bd$rz_storage, type = "l", col = 'black', main = "Basin Scale Root Zone Storage",
    xlab = "Date", ylab = "mm")

#basin scale soil moisture
plot(singlerunvalidation$bd$rz_storage/singlerunvalidation$bdg$root_depth~singlerunvalidation$bd$date, type = "l", main = "RZ_Storage/Root_Depth x Date", xlab = "Date", ylab = "rz_Storage/root_depth", col = 'brown')

plot(singlerunvalidation$bd$lai~singlerunvalidation$bd$date, type = "l", main = "LAI", xlab = "Date", ylab = "LAI", col = 'DarkGreen')

plot(singlerunvalidation$bd$pet~singlerunvalidation$bd$date, type = "l", main = "Potential Evapotranspiration", xlab = "Date", ylab = "PET", col = 'DarkBlue')

plot(singlerunvalidation$bd$et~singlerunvalidation$bd$date, type = "l", main = "Evapotranspiration", xlab = "Date", ylab = "ET", col = 'darkslategray')

plot((singlerunvalidation$bd$unsat_stor/singlerunvalidation$bd$sat_def_z)~singlerunvalidation$bd$date, type = "l", main = "unsat_stor/sat_def_z", xlab = "Date", ylab = "vwc", col = 'DarkGreen')

Merge Observed and Simulated Data

## merge values instead of subsetting to match up with simulated dates
singlerunvalidation$bd<- merge(singlerunvalidation$bd,obsws32, by.x = "date", by.y = "Date", all = FALSE)

## merge soil moisture values but include all data
singlerunvalidation$data <-merge(singlerunvalidation$bd,obsws32sm, by.x = "date", by.y = "Date", all = TRUE)

Plot Observed and Simulated Data, Plot RHESSys Outputs

setwd(system.file("extdata/", package = "RHESSysIOinR"))

## Plot Hydrograph comparing modeled and observed streamflow
{hydrograph(input=singlerunvalidation$bd, streamflow=singlerunvalidation$bd$observedstreamflow, streamflow2 = singlerunvalidation$bd$streamflow, timeSeries = singlerunvalidation$bd$date, precip = singlerunvalidation$bd$streamflow,
           P.units = "mm", S.units = "mm normalized by basin area", S1.col = 'Blue', S2.col = 'Red')

legend("topleft",inset = .2, legend=c("Observed Streamflow","Predicted Streamflow"), col=c("blue","red"), lty=1:2)}

{plot(singlerunvalidation$data$date,singlerunvalidation$data$observedstreamflow.x, type = "l", xlab = "Date", ylab = "Streamflow", main = "Predicted vs Observed Streamflow")
lines(singlerunvalidation$data$date, singlerunvalidation$data$streamflow, col = 'RED')
legend("topright",inset = 0, legend=c("Observed Streamflow","Predicted Streamflow"), col=c("black","red"), lty=1:1)}

{plot(singlerunvalidation$data$date,singlerunvalidation$data$observedstreamflow.x, type = "l", xlab = "Date", ylab = "Streamflow", main = "Predicted vs Observed Log Streamflow", log = "y")
lines(singlerunvalidation$data$date, singlerunvalidation$data$streamflow, col = 'RED')
legend("topright",inset = 0, legend=c("Observed Streamflow","Predicted Streamflow"), col=c("black","red"), lty=1:1)}

predictedvsobservedstreamlm<- lm(observedstreamflow~streamflow, data = singlerunvalidation$bd)

{plot(singlerunvalidation$bd$observedstreamflow,singlerunvalidation$bd$streamflow, xlab = "Observed", ylab = "Predicted", main = "Predicted vs Observed Streamflow", xlim = c(0,55), ylim = c(0,55))
abline(a=0, b=1, col = 'RED', lty = 2, lwd = 2)
legend("right",inset = 0.01, legend = paste("R2 =",format(summary(predictedvsobservedstreamlm)$r.squared,digits=3)))}

{plot(singlerunvalidation$data$date,(singlerunvalidation$data$rz_storage/singlerunvalidation$data$rootdepth), type = "l", ylim = c(0,0.35), xlab = "Date", ylab = "RZ_Storage/Rootdepth", main = "Predicted vs Observed Basin Scale Soil Moisture")
lines(singlerunvalidation$data$date, singlerunvalidation$data$mergedsoilmoisture, col = 'RED')
legend("topright",inset = 0, legend=c("Observed Soil Moisture","Predicted Soil Moisture"), col=c("black","red"), lty=1:1)}

predictedvsobservedsoillm<- lm((rz_storage/rootdepth)~mergedsoilmoisture, data = singlerunvalidation$data)

{plot((singlerunvalidation$data$rz_storage/singlerunvalidation$data$rootdepth),singlerunvalidation$data$mergedsoilmoisture, xlab = "Observed", ylab = "Predicted", main = "Predicted vs Observed Basin Scale Soil Moisture", xlim = c(0.05,0.4), ylim = c(0.05,0.4))
abline(a=0, b=1, col = 'RED', lty = 2, lwd = 2)
legend("right",inset = 0.01, legend = paste("R2 =",format(summary(predictedvsobservedsoillm)$r.squared,digits=3)))}

## Plot other model outputs

par(mfrow=c(5,1), mar = c(2,5,4,2))

plot(singlerunvalidation$bd$date,singlerunvalidation$bd$tmin, type = "l", col = 'BLUE', ylim = c(-15,30), ylab = "Temperature", xlab = "Date")
lines(singlerunvalidation$bd$date,singlerunvalidation$bd$tmax, type = "l", col = 'RED')
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$precip, type = "h", ylab = "Precipitation", xlab = "Date")
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$streamflow, type = "l", ylab = "Streamflow", xlab = "Date", col = 'blue')
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$baseflow, type = "l", ylab = "Baseflow", xlab = "Date", col = 'brown')
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$rz_storage, type = "l", ylab = "RZ Storage", xlab = "Date", col = 'dark green')

plot(singlerunvalidation$bd$date,singlerunvalidation$bd$psn ,type = "l", ylab = "PSN", xlab = "Date")
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$et, type = "l", ylab = "Evaoptranspiration", xlab = "Date")
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$pet, type = "l", ylab = "PET", xlab = "Date")
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$gw.Qout, type = "l", ylab = "Q out", xlab = "Date")
plot(singlerunvalidation$bd$date,singlerunvalidation$bd$gw.storage, type = "l", ylab = "GW Storage", xlab = "Date")

par(mfrow=c(1,1))

### will only plot in growth mode , used to check that vegetation is initialized properly ##
plot(singlerunvalidation$bdg$date, singlerunvalidation$bdg$lai, type = "l", main = "LAI", xlab = "Date", col = 'dark green')

plot(singlerunvalidation$bdg$date, singlerunvalidation$bdg$soilc, type = "l", main = "Soil Carbon", xlab = "Date", col = 'brown')

## plot cal/val sets


obsws32<- read.csv(paste0(filedir,"input_files/streamflow/Daily Streamflow Watershed 32/Daily Streamflow Watershed 32/ObservedWS32.csv"))


obsws32$Date<- as.Date(obsws32$Date)

Caldates<- read.csv("outputfilter/caldates.csv")
Valdates<- read.csv("outputfilter/valdates.csv")

Caldates<- Caldates[,2]
Valdates<- Valdates[,2]

mergedsm<- read.table("outputfilter/mergedsm.csv", header = T, sep = ",")
obsws32sm<- read.table("outputfilter/obsws32sm.csv", header = T, sep = ",")
obsws32sm$Date<- as.Date(obsws32sm$Date,"%Y-%m-%d")

obsws32cal <- obsws32[obsws32$Date >= Caldates[1] & obsws32$Date <= Caldates[2], ]
obsws32val <- obsws32[obsws32$Date >= Valdates[1] & obsws32$Date <= Valdates[2], ]
obsws32smcal <- obsws32sm[obsws32sm$Date >= Caldates[1] & obsws32sm$Date <= Caldates[2], ]
obsws32smval <- obsws32sm[obsws32sm$Date >= Valdates[1] & obsws32sm$Date <= Valdates[2], ]


{plot(singlerunvalidation$data$date,(singlerunvalidation$data$rz_storage/singlerunvalidation$data$rootdepth), type = "l", ylim = c(0,0.35), xlab = "Date", ylab = "RZ_Storage/Rootdepth", main = "Predicted vs Observed Basin Scale Soil Moisture")
lines(obsws32smcal$Date,obsws32smcal$mergedsoilmoisture, col = "BLUE")
lines(obsws32smval$Date,obsws32smval$mergedsoilmoisture, col = "RED")
legend("topright",inset = 0, legend=c("Predicted Soil Moisture","Observed Calibration Soil Moisture", "Observed Validation Soil Moisture"), col=c("black","blue","red"), lty=c(1,1,1))}

{plot(singlerunvalidation$data$date,singlerunvalidation$data$streamflow, type = "l", xlab = "Date", ylab = "Streamflow", main = "Predicted vs Observed Basin Scale Streamflow")
lines(obsws32cal$Date,obsws32cal$observedstreamflow, col = "BLUE")
lines(obsws32val$Date,obsws32val$observedstreamflow, col = "RED")
legend("topright",inset = 0, legend=c("Predicted Streamflow","Observed Calibration Streamflow", "Observed Validation Streamflow"), col=c("black","blue","red"), lty=c(1,1,1))}

Spatial Data import and display of inputs

# Original input maps have been cropped before processing in R, without cropping the RHESSYs preparation in the R environment will not function properly, below are the input maps used by R
setwd(system.file("extdata/", package = "RHESSysIOinR"))

ws32<- raster("grassexport/cwt_ws32/basin_ws32.tif")
patches<- raster("grassexport/cwt_ws32/patch.tif")
acc10<- raster("grassexport/cwt_ws32/acc10.tif")
aspect10<- raster("grassexport/cwt_ws32/aspect10.tif")
#bt1000<- raster("C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata/rasters/cwt_ws32/ws32/b.t1000.tif")
dem10<- raster("grassexport/cwt_ws32/dem10.tif")
dem10f<- raster("grassexport/cwt_ws32/dem10f.tif")
dir10<- raster("grassexport/cwt_ws32/dir10.tif")
drain10<- raster("grassexport/cwt_ws32/drain10.tif")
#ht1000<- raster("C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata/rasters/cwt_ws32/ws32/h.t1000.tif")
hillslope<- raster("grassexport/cwt_ws32/hillslope.tif")
roads<- brick("grassexport/cwt_ws32/roads.tif")
#shade10<- raster("C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata/rasters/cwt_ws32/ws32/shade10.tif")
slope10<- raster("grassexport/cwt_ws32/slope10.tif")
streams<- raster("grassexport/cwt_ws32/streams.tif")
topidx10<- raster("grassexport/cwt_ws32/topidx10_100.tif")
#xmap<- raster("C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata/rasters/cwt_ws32/ws32/xmap.tif")
#ymap<- raster("C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata/rasters/cwt_ws32/ws32/ymap.tif")

ObservedSMLocationsnt <- read_sf(paste0(filedir,"input_files/soil_moisture/knb-lter-cwt.1308.19/1308.kml"))

ObservedSMLocations <- st_transform(ObservedSMLocationsnt, crs(dem10))

plot(ws32, main ="ws32")

plot(patches, main = "patches")

plot(acc10, main = "acc10")

plot(aspect10, main = "aspect10")

#levelplot(bt1000, col.regions = brewer.pal(name='Spectral', n = 11),at=seq(0,6500,1))
#plot(bt1000, main = "bt1000")
plot(dem10, main = "dem10")

plot(dem10f, main = "dem10f")

plot(dir10, main = "dir10")

plot(drain10, main = "drain10")

#plot(ht1000, main = "ht1000")
{plot(hillslope, main = "hillslope")
  points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", lwd = 1)}

plot(roads, main = "roads")

#plot(shade10, main = "shade10")
plot(slope10, main = "slope10")

plot(streams, main = "streams")

plot(topidx10, main = "topidx10")

#plot(xmap, main = "xmap")
#plot(ymap, main = "ymap")

Show locations of measured soil moisture and soil maps

setwd(system.file("extdata/", package = "RHESSysIOinR"))


soilstaticmap<- raster("grassexport/cwt_ws32/staticsoil.tif")

soilssurgo<- raster("grassexport/cwt_ws32/ssurgosoil.tif")
soildsm<- raster("grassexport/cwt_ws32/dsmsoil.tif")

colorramp<- viridis(128)

{plot(dem10, col = colorramp, main = "Coweeta Observed Soil Moisture Locations")
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", lwd = 1)}

matrix(c(ObservedSMLocations$Name[3],ObservedSMLocations$Name[4],ObservedSMLocations$Name[5],ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1],ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), nrow = 3, ncol = 3)
##      [,1]              [,2]               [,3]              
## [1,] "132 plot center" "275432.649744231" "3881522.05364127"
## [2,] "232 plot center" "275578.214010129" "3881428.55011708"
## [3,] "332 plot center" "275760.864807773" "3881284.18476691"
{plot(soilstaticmap, col = colorramp, main = "Coweeta Observed Soil Moisture Locations on Static Soil Map")
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", lwd = 1)}

{plot(soilssurgo, col = colorramp, main = "Coweeta Observed Soil Moisture Locations on SSURGO Soil Map")
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", lwd = 1)}

{plot(soildsm, col = colorramp, main = "Coweeta Observed Soil Moisture Locations on RSS Soil Map")
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", lwd = 1)}

Display outputs from model run

setwd(system.file("extdata/", package = "RHESSysIOinR"))
## Extract values for single date
displayday <- singlerunvalidation$pd[which(singlerunvalidation$pd$date=="2018-03-21")]

## reclassify all patches to na and then reclassify to model output values
reclass_all<- c(-2147483648, 2147483647,NA)
reclass_allm<- matrix(reclass_all, ncol = 3, byrow = TRUE)
displaydaypatches<- reclassify(patches,reclass_allm)

displayday$calculatedrzsm <- displayday$rz_storage/displayday$root.depth

reclass_displayday <- cbind(displayday$patchID,displayday$calculatedrzsm)
reclass_displayday <- as.matrix(reclass_displayday)

displaydaypatches<- reclassify(patches,reclass_displayday)

## Plot Spatial Data Output for RZ Storage
#plot(displaydaypatches, xlim = c(280900,282500), ylim = c(4870000,4872000))

{plot(mask(displaydaypatches,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600))
title("CW WS32 RZ Soil Moisture Prediction for 1 day", line = -2)
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", cex = 2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

reclass_displayday <- cbind(displayday$patchID,displayday$root.depth)
reclass_displayday <- as.matrix(reclass_displayday)
displaydaypatches2<- reclassify(patches,reclass_displayday)

{plot(mask(displaydaypatches2,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600))
title("CW WS32 root.depth Prediction for 1 day", line = -2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

reclass_displayday <- cbind(displayday$patchID,displayday$rz_storage)
reclass_displayday <- as.matrix(reclass_displayday)
displaydaypatches3<- reclassify(patches,reclass_displayday)

{plot(mask(displaydaypatches3,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600))
title("CW WS32 rz_storage Prediction for 1 day", line = -2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

reclass_displayday <- cbind(displayday$patchID,displayday$sat_def)
reclass_displayday <- as.matrix(reclass_displayday)
displaydaypatches4<- reclassify(patches,reclass_displayday)

{plot(mask(displaydaypatches4,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600))
title("CW WS32 Saturation Deficit Prediction for 1 day in mm", line = -2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

reclass_displayday <- cbind(displayday$patchID,(displayday$unsat_stor/displayday$sat_def_z))
reclass_displayday <- as.matrix(reclass_displayday)
displaydaypatches5<- reclassify(patches,reclass_displayday)

{plot(mask(displaydaypatches5,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600))
title("CW WS32 unsaturated soil moisture vwc Prediction for 1 day", line = -2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

reclass_displayday <- cbind(displayday$patchID,((displayday$root_zone.S*displayday$potential_rz_store)/displayday$root.depth))
reclass_displayday <- as.matrix(reclass_displayday)
displaydaypatches6<- reclassify(patches,reclass_displayday)

{plot(mask(displaydaypatches6,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600), zlim = c(0,0.50))
title("CW WS32 Rooting Depth VWC Prediction for 1 day", line = -2)
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", cex = 2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

{plot(mask(displaydaypatches,ws32), xlim = c(275000,276200), ylim = c(3881000,3881600), zlim = c(0,0.50))
title("CW WS32 RZ Soil Moisture Prediction for 1 day", line = -2)
points(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1]), c(ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), pch = 21, col = "black", bg = "red", cex = 2)
scalebar(200, xy=c(275200, 3880800), type='line',divs = "2")}

## Plot Hydrograph
{hydrograph(input=singlerunvalidation$bd, streamflow=singlerunvalidation$bd$observedstreamflow, streamflow2 = singlerunvalidation$bd$streamflow, timeSeries = singlerunvalidation$bd$date, precip = singlerunvalidation$bd$streamflow,
           P.units = "mm", S.units = "mm normalized by basin area", S1.col = 'Blue', S2.col = 'Red')
legend("topleft",inset = .2, legend=c("Observed Streamflow","Predicted Streamflow"), col=c("blue","red"), lty=1:2)}

### end show patch map

patchnumbers<- raster::extract(patches,matrix(c(ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1],ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2]), nrow = 3, ncol = 2))


ObserveSoilMoisturePatches <- matrix(c(ObservedSMLocations$Name[3],ObservedSMLocations$Name[4],ObservedSMLocations$Name[5],ObservedSMLocations[[3]][[3]][1],ObservedSMLocations[[3]][[4]][1],ObservedSMLocations[[3]][[5]][1],ObservedSMLocations[[3]][[3]][2],ObservedSMLocations[[3]][[4]][2],ObservedSMLocations[[3]][[5]][2],patchnumbers), nrow = 3, ncol = 4)


## Extract values for a single patch, select patch ID
ObserveSoilMoisturePatches[1,4]
## [1] "136557"
displaypatch<- singlerunvalidation$pd[which(singlerunvalidation$pd$patchID==ObserveSoilMoisturePatches[1,4])]
ObserveSoilMoisturePatches[2,4]
## [1] "141942"
displaypatch2<- singlerunvalidation$pd[which(singlerunvalidation$pd$patchID==ObserveSoilMoisturePatches[2,4])]
ObserveSoilMoisturePatches[3,4]
## [1] "149478"
displaypatch3<- singlerunvalidation$pd[which(singlerunvalidation$pd$patchID==ObserveSoilMoisturePatches[3,4])]

plot(displaypatch$date,(displaypatch$rz_storage/displaypatch$root.depth), type = "l", xlab = "Date", ylab = "RZ Storage", main = 'CW WS27 More Detailed RZ Storage Patch #147322', ylim = c(0,.4))

# 
# ##rewrite to take markdown into account, must load in means
# {plot(smws32_1mean$Group.1,smws32_1mean$smois30A, type = "l", ylim = c(0,.4), col = 'darkorange', xlim=as.Date(c("2016-10-1","2019-10-1")), main = "CW WS32 More Detailed Soil Moisture vs Patches",
#      xlab = "Date", ylab = "Soil Moisture mm")
# lines(smws32_2mean$Group.1,smws32_2mean$smois30A,type = "l", col = 'darkred')
# lines(smws32_3mean$Group.1,smws32_3mean$smois30A,type = "l", col = 'blue')
# lines(displaypatch$date,(displaypatch$rz_storage/displaypatch$root.depth), type = "l", xlab = "Date", ylab = "RZ Storage", col = 'red', lty = 2)
# lines(displaypatch2$date,(displaypatch2$rz_storage/displaypatch2$root.depth), type = "l", xlab = "Date", ylab = "RZ Storage", col = 'green', lty = 2)
# lines(displaypatch3$date,(displaypatch3$rz_storage/displaypatch3$root.depth), type = "l", xlab = "Date", ylab = "RZ Storage", col = 'black', lty = 2)
# 
# 
# 
# # plot(smws32_1mean$smois30A,(displaypatch$rz_storage/displaypatch$root.depth))
# 
# legend("bottomleft",inset = .01, legend=c("Observed Patch 1","Predicted Patch 1","Observed Patch 2","Predicted Patch 2","Observed Patch 3","Predicted Patch 3"), col=c("darkorange", "red","darkred","green","blue","black"), lty=c(1,2,1,2,1,2))}
# 
# {plot(smws32_2mean$Group.1,smws32_2mean$smois30A, type = "l", ylim = c(0,0.4), col = 'BLUE', xlim=as.Date(c("2016-10-1","2019-10-1")), main = "CW WS32 More Detailed Soil Moisture vs Patch #154914",
#      xlab = "Date", ylab = "Soil Moisture mm")
# lines(displaypatch$date,(displaypatch$rz_storage/displaypatch$root.depth), type = "l",lwd = 2, xlab = "Date", ylab = "RZ Storage", main = 'CW WS27 More Detailed RZ Storage Patch #154914', col = 'red')
# lines(displaypatch$date, ((displaypatch$root_zone.S*displaypatch$potential_rz_store)/displaypatch$root.depth), type = "l", col = "green")
# legend("bottomleft",inset = .01, legend=c("Observed Soil Moisture","Predicted Soil Moisture"), col=c("blue","red"), lty=1:1)}




head(obsws32cal)
##           X       Date flow discharge_mm observedstreamflow
## 22961 22961 2017-01-01 2.30     2.172645           2.172645
## 22962 22962 2017-01-02 3.04     2.871669           2.871669
## 22963 22963 2017-01-03 2.72     2.569388           2.569388
## 22964 22964 2017-01-04 2.11     1.993165           1.993165
## 22965 22965 2017-01-05 1.92     1.813686           1.813686
## 22966 22966 2017-01-06 1.81     1.709777           1.709777
head(obsws32val)
##           X       Date flow discharge_mm observedstreamflow
## 23311 23311 2017-12-17 2.14     2.021504           2.021504
## 23312 23312 2017-12-18 2.27     2.144306           2.144306
## 23313 23313 2017-12-19 2.23     2.106521           2.106521
## 23314 23314 2017-12-20 3.39     3.202289           3.202289
## 23315 23315 2017-12-21 2.74     2.588281           2.588281
## 23316 23316 2017-12-22 2.60     2.456033           2.456033
head(obsws32smcal)
##   X       Date flow discharge_mm observedstreamflow smois30site1a smois30site1b
## 1 1 2017-01-01 2.30     2.172645           2.172645     0.2194375     0.2468125
## 2 2 2017-01-02 3.04     2.871669           2.871669     0.2241528     0.2509896
## 3 3 2017-01-03 2.72     2.569388           2.569388     0.2184132     0.2409236
## 4 4 2017-01-04 2.11     1.993165           1.993165     0.1952743     0.2236250
## 5 5 2017-01-05 1.92     1.813686           1.813686     0.1825451     0.2149410
## 6 6 2017-01-06 1.81     1.709777           1.709777     0.1745729     0.2097500
##   smois60site1a smois60site1b smois30site2a smois30site2b smois60site2a
## 1     0.1988021     0.2463715     0.2162465     0.2141181     0.2191528
## 2     0.2243646     0.2737917     0.2244410     0.2392847     0.2239028
## 3     0.2177813     0.2657361     0.2209722     0.2291771     0.2154028
## 4     0.1993090     0.2483194     0.2058437     0.2039549     0.1967431
## 5     0.1845556     0.2335799     0.1972882     0.1883021     0.1870486
## 6     0.1744132     0.2231181     0.1914861     0.1774236     0.1808646
##   smois60site2b smois30site3a smois30site3b smois60site3a smois60site3b
## 1     0.1775868     0.2830729     0.2573576     0.2625312     0.2399167
## 2     0.2186528     0.2833924     0.2626007     0.2942917     0.2684410
## 3     0.2180486     0.2697604     0.2480833     0.2926944     0.2704132
## 4     0.1968403     0.2399167     0.2206285     0.2794965     0.2609514
## 5     0.1786215     0.2264861     0.2081111     0.2668299     0.2512847
## 6     0.1669340     0.2187014     0.2009896     0.2569028     0.2437292
##   mergedsoilmoisture
## 1          0.2317839
## 2          0.2490255
## 3          0.2422839
## 4          0.2225752
## 5          0.2099661
## 6          0.2015738
head(obsws32smval)
##       X       Date flow discharge_mm observedstreamflow smois30site1a
## 351 351 2017-12-17 2.14     2.021504           2.021504     0.1181493
## 352 352 2017-12-18 2.27     2.144306           2.144306     0.1165625
## 353 353 2017-12-19 2.23     2.106521           2.106521     0.1135139
## 354 354 2017-12-20 3.39     3.202289           3.202289     0.1484514
## 355 355 2017-12-21 2.74     2.588281           2.588281     0.1391528
## 356 356 2017-12-22 2.60     2.456033           2.456033     0.1312049
##     smois30site1b smois60site1a smois60site1b smois30site2a smois30site2b
## 351     0.2395313     0.1677882     0.2054826     0.1575382     0.1352778
## 352     0.2392708     0.1635625     0.2064132     0.1605903     0.1370000
## 353     0.2332326     0.1600174     0.2057812     0.1585660     0.1363750
## 354     0.2609861     0.1844479     0.2319132     0.1872778     0.1721458
## 355     0.2532083     0.2092639     0.2517917     0.1925139     0.1736111
## 356     0.2428194     0.1954965     0.2400937     0.1847604     0.1649479
##     smois60site2a smois60site2b smois30site3a smois30site3b smois60site3a
## 351            NA    0.09663194     0.2347188     0.1869757     0.2350000
## 352            NA    0.09784375     0.2385694     0.1832847     0.2350000
## 353            NA    0.09828472     0.2289757     0.1792153     0.2350000
## 354            NA    0.12405208     0.2609826     0.2203681     0.2421354
## 355            NA    0.14059028     0.2525278     0.2136979     0.2712326
## 356            NA    0.13011806     0.2397049     0.1995382     0.2683160
##     smois60site3b mergedsoilmoisture
## 351     0.2169896          0.1812803
## 352     0.2167847          0.1813529
## 353     0.2160000          0.1786329
## 354     0.2173993          0.2045600
## 355     0.2365937          0.2121985
## 356     0.2404201          0.2034018
#subset Validation range based on Val Dates set by available SM data

validationsubset <- singlerunvalidation$bd[singlerunvalidation$bd$date >= Valdates[1] & singlerunvalidation$bd$date <= Valdates[2], ]

## Fit tests for streamflow

NSE(validationsubset$streamflow,validationsubset$observedstreamflow)
## [1] 0.6757868
NSE(validationsubset$streamflow,validationsubset$observedstreamflow, FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE)
## [1] 0.8907935
KGE(validationsubset$streamflow,validationsubset$observedstreamflow)
## [1] 0.6818219
# Plot Observed and Predicted Streamflow

{plot(validationsubset$date,validationsubset$streamflow, type = 'l', lty = 2, col = 'RED', main = "Validation Subset Observed and Predicted Streamflow")
lines(validationsubset$date,validationsubset$observedstreamflow, type = 'l', col = 'BLACK')
legend("topright",inset = .1, legend=c("Observed Streamflow","Predicted Streamflow"), col=c("black","red"), lty=1:2)}

{plot(singlerunvalidation$bd$date,singlerunvalidation$bd$streamflow, type = 'l', lty = 2, col = 'RED', main = "Observed and Predicted Streamflow")
lines(singlerunvalidation$bd$date,singlerunvalidation$bd$observedstreamflow, type = 'l', col = 'BLACK')
legend("topright",inset = .1, legend=c("Observed Streamflow","Predicted Streamflow"), col=c("black","red"), lty=1:2)}

#Plot Model RZ SM outputs for patch
{plot(displaypatch$date,(displaypatch$rz_storage/displaypatch$root.depth), type = "l",ylim = c(0,0.50), ylab = "Root Zone Storage (mm/m) ", xlab = "Date", main = 'Root Zone Display Patch')
lines(displaypatch$date,(displaypatch$rz_field_capacity/displaypatch$root.depth), type = "l", col = "blue")
lines(displaypatch$date,(displaypatch$rz_wilting_point/displaypatch$root.depth), type = "l", col = "red")
legend("bottomleft",inset = .1, legend=c("Predicted RZ Storage","RZ Field Capacity","RZ Wilting Point"), col=c("black","blue","red"), lty=1:1)}

{plot(displaypatch$date,(displaypatch$unsat_stor/displaypatch$sat_def_z), type = "l",ylim = c(0,0.50), ylab = "Root Zone Storage (mm/m) ", xlab = "Date", main = 'Root Zone Display Patch')
legend("bottomleft",inset = .1, legend=c("Predicted RZ Storage","RZ Field Capacity","RZ Wilting Point"), col=c("black","blue","red"), lty=1:1)}

# must take seperate markdown file into account, load in mean sm files

# {plot(smws32_2mean$Group.1,smws32_2mean$smois30A, type = "l", ylim = c(0,0.4), col = 'BLUE', xlim=as.Date(c("2016-10-1","2019-10-1")), main = "CW WS32 More Saturated Zone VWC vs Patch #154914",
#      xlab = "Date", ylab = "Soil Moisture mm")
# lines(displaypatch$date,(displaypatch$unsat_stor/displaypatch$sat_def_z), type = "l", xlab = "Date", ylab = "RZ Storage", main = 'CW WS27 More Detailed RZ Storage Patch #154914', col = 'red')
# legend("bottomleft",inset = .01, legend=c("Observed Soil Moisture","Predicted Soil Moisture"), col=c("blue","red"), lty=1:1)}

Combine calibration outputs

setwd(system.file("extdata/", package = "RHESSysIOinR"))
getwd()
## [1] "C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata"
dsmdist<- read.csv("out/dsmcalibrationoutput.txt", sep=" ")
ssurgodist<- read.csv("out/ssurgocalibrationoutput.txt", sep = " ")
staticdist<- read.csv("out/staticcalibrationoutput.txt", sep = " ")

paged_table(ssurgodist)
paged_table(dsmdist)
paged_table(staticdist)
ssurgodist$treatment<- 'SSURGO'
dsmdist$treatment<- 'RSS'
staticdist$treatment<- 'Static'

combineddist<- rbind(ssurgodist, dsmdist, staticdist)

ggplot(combineddist, aes(calsmKGE, fill = treatment))+ geom_density(alpha=0.3)

ggplot(combineddist, aes(calKGE, fill = treatment))+ geom_density(alpha=0.3)

smKGEplot<- ggplot(combineddist, aes(calsmKGE, y = treatment, fill = treatment))+ geom_boxplot()+ xlab("Soil Moisture KGE - Calibration") +ylab("Soil Map Input")

KGEplot<- ggplot(combineddist, aes(calKGE, y = treatment, fill = treatment))+ geom_boxplot()+ xlab("Streamflow KGE - Calibration")+ylab(NULL)

ggarrange(smKGEplot,KGEplot, common.legend = TRUE, legend = "top")

smKGEplot<- ggplot(combineddist, aes(calsmKGE, y = treatment, fill = treatment))+ geom_boxplot()+ xlab("Soil Moisture KGE - Calibration") +ylab("Soil Map Input")

KGEplot<- ggplot(combineddist, aes(calKGE, y = treatment, fill = treatment))+ geom_boxplot()+ xlab("Streamflow KGE - Calibration")+ylab(NULL)

ggarrange(smKGEplot,KGEplot, common.legend = TRUE, legend = "top")

text <- "Coweeta Watershed 32 Calibration Performance"
# Create a text grob
tgrob <- text_grob(text,size = 16)
# Draw the text
plot_0 <- as_ggplot(tgrob) + theme(plot.margin = margin(0,3,0,12, "cm"))

ggarrange(plot_0,NULL,smKGEplot,KGEplot,
          ncol = 2,nrow = 2,heights = c(1,5), common.legend = TRUE, legend = "none")

smKGEviolinplot<- ggplot(combineddist, aes(calsmKGE, y = treatment, fill = treatment))+ geom_violin()+ xlab("Soil Moisture KGE - Calibration") +ylab("Soil Map Input")

KGEviolinplot<- ggplot(combineddist, aes(calKGE, y = treatment, fill = treatment))+ geom_violin()+ xlab("Streamflow KGE - Calibration")+ylab(NULL)

ggarrange(smKGEviolinplot,KGEviolinplot, common.legend = TRUE, legend = "top")

library(multcompView)
library(datasets)

oneway.test(valsmKGE~treatment, data= combineddist, var.equal = TRUE)
## 
##  One-way analysis of means
## 
## data:  valsmKGE and treatment
## F = 0, num df = 2, denom df = 15, p-value = 1
anova<- aov(valsmKGE~treatment, data = combineddist)

summary(anova)
##             Df Sum Sq Mean Sq F value Pr(>F)
## treatment    2 0.0000  0.0000       0      1
## Residuals   15 0.6869  0.0458
tukey <- TukeyHSD(anova)
print(tukey)
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = valsmKGE ~ treatment, data = combineddist)
## 
## $treatment
##                       diff        lwr       upr p adj
## SSURGO-RSS    0.000000e+00 -0.3209235 0.3209235     1
## Static-RSS    2.775558e-17 -0.3209235 0.3209235     1
## Static-SSURGO 2.775558e-17 -0.3209235 0.3209235     1
cld <- multcompLetters4(anova,tukey)

print(cld)
## $treatment
## $treatment$Letters
##    RSS SSURGO Static 
##    "a"    "a"    "a" 
## 
## $treatment$LetterMatrix
##           a
## RSS    TRUE
## SSURGO TRUE
## Static TRUE

Run top n model runs for validation

50/50 weighting

validation will only run 2 years before prediction time period

combineddist
##            m          k  soil_dep       m_v       k_v       gw1       gw2
## 1  4.2654186  0.8215337 0.2189720  7.069720  1.676569 0.1736721 0.3461870
## 2  1.7904894 51.2137518 0.3015676 11.165983  9.107519 0.2222399 0.4225942
## 3  0.5065417 30.0613653 0.4777003 10.797779 10.706822 0.1578457 0.2059236
## 4  0.9518290 23.1992458 0.1347333  1.705931 13.484377 0.2596880 0.4397365
## 5  1.8834547 47.7403440 0.3943811  9.121720  5.810185 0.1284071 0.5473516
## 6  2.0238633 53.2962389 0.1269450 13.427663  5.049880 0.2825755 0.3843345
## 11 4.2654186  0.8215337 0.2189720  7.069720  1.676569 0.1736721 0.3461870
## 21 1.7904894 51.2137518 0.3015676 11.165983  9.107519 0.2222399 0.4225942
## 31 0.5065417 30.0613653 0.4777003 10.797779 10.706822 0.1578457 0.2059236
## 41 0.9518290 23.1992458 0.1347333  1.705931 13.484377 0.2596880 0.4397365
## 51 1.8834547 47.7403440 0.3943811  9.121720  5.810185 0.1284071 0.5473516
## 61 2.0238633 53.2962389 0.1269450 13.427663  5.049880 0.2825755 0.3843345
## 12 4.2654186  0.8215337 0.2189720  7.069720  1.676569 0.1736721 0.3461870
## 22 1.7904894 51.2137518 0.3015676 11.165983  9.107519 0.2222399 0.4225942
## 32 0.5065417 30.0613653 0.4777003 10.797779 10.706822 0.1578457 0.2059236
## 42 0.9518290 23.1992458 0.1347333  1.705931 13.484377 0.2596880 0.4397365
## 52 1.8834547 47.7403440 0.3943811  9.121720  5.810185 0.1284071 0.5473516
## 62 2.0238633 53.2962389 0.1269450 13.427663  5.049880 0.2825755 0.3843345
##           pa       po   vgseng1   vgseng2   vgseng3 run rowname       NSE
## 1  0.4645812 1.096790 1.0888779 0.5387504 1.0425659   1    6863 -1.074271
## 2  0.2702434 1.629240 0.1842543 1.8194417 1.5448294   2    8808 -1.074098
## 3  0.7092941 1.862676 1.4071374 1.3870897 0.2884155   3    2476 -1.075548
## 4  0.7180613 1.197692 1.7033005 1.1561331 1.6906791   4    7950 -1.074948
## 5  0.6487253 1.808287 1.7071025 0.2770891 1.3544152   5    3835 -1.074245
## 6  0.9058496 1.332713 0.5317341 0.9110006 0.6218084   6    6577 -1.075435
## 11 0.4645812 1.096790 1.0888779 0.5387504 1.0425659   1    6863 -1.073988
## 21 0.2702434 1.629240 0.1842543 1.8194417 1.5448294   2    8808 -1.074148
## 31 0.7092941 1.862676 1.4071374 1.3870897 0.2884155   3    2476 -1.075433
## 41 0.7180613 1.197692 1.7033005 1.1561331 1.6906791   4    7950 -1.074795
## 51 0.6487253 1.808287 1.7071025 0.2770891 1.3544152   5    3835 -1.074428
## 61 0.9058496 1.332713 0.5317341 0.9110006 0.6218084   6    6577 -1.075504
## 12 0.4645812 1.096790 1.0888779 0.5387504 1.0425659   1    6863 -1.074619
## 22 0.2702434 1.629240 0.1842543 1.8194417 1.5448294   2    8808 -1.074692
## 32 0.7092941 1.862676 1.4071374 1.3870897 0.2884155   3    2476 -1.075993
## 42 0.7180613 1.197692 1.7033005 1.1561331 1.6906791   4    7950 -1.075295
## 52 0.6487253 1.808287 1.7071025 0.2770891 1.3544152   5    3835 -1.075303
## 62 0.9058496 1.332713 0.5317341 0.9110006 0.6218084   6    6577 -1.076116
##        lnNSE        KGE     smNSE    smlnNSE       smKGE    calNSE  callnNSE
## 1  -41.50870 -0.4698061 -1.937750  -2.261907 -0.13964486 -5.303346 -148.0495
## 2  -41.35338 -0.4705037 -7.404988 -11.765507 -0.09886063 -5.302188 -147.2789
## 3  -42.44749 -0.5643969 -6.779262 -11.330996 -0.23939092 -5.310434 -151.8203
## 4  -42.09659 -0.5197475 -4.564581  -6.885572 -0.28828748 -5.306079 -149.8466
## 5  -41.46535 -0.4876675 -6.759501 -11.005991 -0.16980764 -5.302948 -147.7647
## 6  -42.12467 -0.6130486 -4.644010  -7.195072 -0.22020833 -5.307841 -150.3461
## 11 -41.44601 -0.4608508 -1.937750  -2.261907 -0.13964486 -5.302334 -147.9313
## 21 -41.46555 -0.4665195 -7.404988 -11.765507 -0.09886063 -5.302700 -147.8225
## 31 -42.39366 -0.5626434 -6.779262 -11.330996 -0.23939092 -5.309801 -151.5727
## 41 -42.03889 -0.5122919 -4.564581  -6.885572 -0.28828748 -5.305189 -149.5275
## 51 -41.65685 -0.5009702 -6.759501 -11.005991 -0.16980764 -5.303775 -148.5624
## 61 -42.19785 -0.6276096 -4.644010  -7.195072 -0.22020833 -5.307964 -150.5135
## 12 -41.81357 -0.5151486 -1.937750  -2.261907 -0.13964486 -5.304300 -148.9959
## 22 -41.74623 -0.5279653 -7.404988 -11.765507 -0.09886063 -5.304495 -148.7533
## 32 -42.65434 -0.6001711 -6.779262 -11.330996 -0.23939092 -5.312006 -152.8901
## 42 -42.28931 -0.5566172 -4.564581  -6.885572 -0.28828748 -5.307799 -150.5663
## 52 -42.11144 -0.6149768 -6.759501 -11.005991 -0.16980764 -5.307202 -150.1105
## 62 -42.59342 -0.7150382 -4.644010  -7.195072 -0.22020833 -5.311753 -152.4474
##        calKGE  calsmNSE calsmlnNSE    calsmKGE    valNSE  vallnNSE     valKGE
## 1  -0.5131559 -1.937750  -2.261907 -0.13964486 -2.606855 -89.20050 -0.4737093
## 2  -0.5474325 -7.404988 -11.765507 -0.09886063 -2.606619 -88.95356 -0.5326562
## 3  -0.6792857 -6.779262 -11.330996 -0.23939092 -2.608884 -90.55445 -0.7564513
## 4  -0.4952038 -4.564581  -6.885572 -0.28828748 -2.608376 -90.20615 -0.6679259
## 5  -0.5456229 -6.759501 -11.005991 -0.16980764 -2.607001 -89.22988 -0.5553813
## 6  -0.6202306 -4.644010  -7.195072 -0.22020833 -2.608352 -90.15736 -0.6864253
## 11 -0.4712902 -1.937750  -2.261907 -0.13964486 -2.606518 -89.10235 -0.4638593
## 21 -0.5009698 -7.404988 -11.765507 -0.09886063 -2.606863 -89.17992 -0.5372521
## 31 -0.6471590 -6.779262 -11.330996 -0.23939092 -2.608882 -90.55725 -0.5131821
## 41 -0.4741126 -4.564581  -6.885572 -0.28828748 -2.608339 -90.19089 -0.6609060
## 51 -0.5090750 -6.759501 -11.005991 -0.16980764 -2.607620 -89.67716 -0.6287369
## 61 -0.6139517 -4.644010  -7.195072 -0.22020833 -2.608640 -90.37677 -0.6983202
## 12 -0.5047879 -1.937750  -2.261907 -0.13964486 -2.607836 -89.89466 -0.5353852
## 22 -0.5419699 -7.404988 -11.765507 -0.09886063 -2.607774 -89.76829 -0.6324556
## 32 -0.5855496 -6.779262 -11.330996 -0.23939092 -2.608879 -90.55510 -0.5505982
## 42 -0.5788510 -4.564581  -6.885572 -0.28828748 -2.608867 -90.54142 -0.7391653
## 52 -0.6249333 -6.759501 -11.005991 -0.16980764 -2.608687 -90.40521 -0.7215756
## 62 -0.8098918 -4.644010  -7.195072 -0.22020833 -2.608892 -90.56199 -0.5682706
##      valsmNSE valsmlnNSE   valsmKGE treatment
## 1   -5.891048  -9.123515  0.2571265    SSURGO
## 2  -23.823269 -49.846647  0.2873930    SSURGO
## 3  -23.985343 -52.300590  0.1359405    SSURGO
## 4  -15.719842 -31.739606 -0.1905734    SSURGO
## 5  -22.779159 -48.780093  0.1881849    SSURGO
## 6  -16.766663 -34.621086 -0.1780992    SSURGO
## 11  -5.891048  -9.123515  0.2571265       RSS
## 21 -23.823269 -49.846647  0.2873930       RSS
## 31 -23.985343 -52.300590  0.1359405       RSS
## 41 -15.719842 -31.739606 -0.1905734       RSS
## 51 -22.779159 -48.780093  0.1881849       RSS
## 61 -16.766663 -34.621086 -0.1780992       RSS
## 12  -5.891048  -9.123515  0.2571265    Static
## 22 -23.823269 -49.846647  0.2873930    Static
## 32 -23.985343 -52.300590  0.1359405    Static
## 42 -15.719842 -31.739606 -0.1905734    Static
## 52 -22.779159 -48.780093  0.1881849    Static
## 62 -16.766663 -34.621086 -0.1780992    Static
plot(ssurgodist$calKGE, ssurgodist$calsmKGE, pch = 19, xlab = "Streamflow KGE", ylab = "Soil Moisture KGE")

combineddist$weightedcal<- rowMeans(combineddist[,c("calKGE","calsmKGE")],)

ordereddist <- combineddist[order(-combineddist$weightedcal),]

ordereddist[ordereddist$treatment=="Static",]
##            m          k  soil_dep       m_v       k_v       gw1       gw2
## 22 1.7904894 51.2137518 0.3015676 11.165983  9.107519 0.2222399 0.4225942
## 12 4.2654186  0.8215337 0.2189720  7.069720  1.676569 0.1736721 0.3461870
## 52 1.8834547 47.7403440 0.3943811  9.121720  5.810185 0.1284071 0.5473516
## 32 0.5065417 30.0613653 0.4777003 10.797779 10.706822 0.1578457 0.2059236
## 42 0.9518290 23.1992458 0.1347333  1.705931 13.484377 0.2596880 0.4397365
## 62 2.0238633 53.2962389 0.1269450 13.427663  5.049880 0.2825755 0.3843345
##           pa       po   vgseng1   vgseng2   vgseng3 run rowname       NSE
## 22 0.2702434 1.629240 0.1842543 1.8194417 1.5448294   2    8808 -1.074692
## 12 0.4645812 1.096790 1.0888779 0.5387504 1.0425659   1    6863 -1.074619
## 52 0.6487253 1.808287 1.7071025 0.2770891 1.3544152   5    3835 -1.075303
## 32 0.7092941 1.862676 1.4071374 1.3870897 0.2884155   3    2476 -1.075993
## 42 0.7180613 1.197692 1.7033005 1.1561331 1.6906791   4    7950 -1.075295
## 62 0.9058496 1.332713 0.5317341 0.9110006 0.6218084   6    6577 -1.076116
##        lnNSE        KGE     smNSE    smlnNSE       smKGE    calNSE  callnNSE
## 22 -41.74623 -0.5279653 -7.404988 -11.765507 -0.09886063 -5.304495 -148.7533
## 12 -41.81357 -0.5151486 -1.937750  -2.261907 -0.13964486 -5.304300 -148.9959
## 52 -42.11144 -0.6149768 -6.759501 -11.005991 -0.16980764 -5.307202 -150.1105
## 32 -42.65434 -0.6001711 -6.779262 -11.330996 -0.23939092 -5.312006 -152.8901
## 42 -42.28931 -0.5566172 -4.564581  -6.885572 -0.28828748 -5.307799 -150.5663
## 62 -42.59342 -0.7150382 -4.644010  -7.195072 -0.22020833 -5.311753 -152.4474
##        calKGE  calsmNSE calsmlnNSE    calsmKGE    valNSE  vallnNSE     valKGE
## 22 -0.5419699 -7.404988 -11.765507 -0.09886063 -2.607774 -89.76829 -0.6324556
## 12 -0.5047879 -1.937750  -2.261907 -0.13964486 -2.607836 -89.89466 -0.5353852
## 52 -0.6249333 -6.759501 -11.005991 -0.16980764 -2.608687 -90.40521 -0.7215756
## 32 -0.5855496 -6.779262 -11.330996 -0.23939092 -2.608879 -90.55510 -0.5505982
## 42 -0.5788510 -4.564581  -6.885572 -0.28828748 -2.608867 -90.54142 -0.7391653
## 62 -0.8098918 -4.644010  -7.195072 -0.22020833 -2.608892 -90.56199 -0.5682706
##      valsmNSE valsmlnNSE   valsmKGE treatment weightedcal
## 22 -23.823269 -49.846647  0.2873930    Static  -0.3204153
## 12  -5.891048  -9.123515  0.2571265    Static  -0.3222164
## 52 -22.779159 -48.780093  0.1881849    Static  -0.3973705
## 32 -23.985343 -52.300590  0.1359405    Static  -0.4124703
## 42 -15.719842 -31.739606 -0.1905734    Static  -0.4335692
## 62 -16.766663 -34.621086 -0.1780992    Static  -0.5150501
topstatic<- ordereddist[ordereddist$treatment=="Static",]
topssurgo<- ordereddist[ordereddist$treatment=="SSURGO",]
toprss<- ordereddist[ordereddist$treatment=="RSS",]

toprss
##            m          k  soil_dep       m_v       k_v       gw1       gw2
## 21 1.7904894 51.2137518 0.3015676 11.165983  9.107519 0.2222399 0.4225942
## 11 4.2654186  0.8215337 0.2189720  7.069720  1.676569 0.1736721 0.3461870
## 51 1.8834547 47.7403440 0.3943811  9.121720  5.810185 0.1284071 0.5473516
## 41 0.9518290 23.1992458 0.1347333  1.705931 13.484377 0.2596880 0.4397365
## 61 2.0238633 53.2962389 0.1269450 13.427663  5.049880 0.2825755 0.3843345
## 31 0.5065417 30.0613653 0.4777003 10.797779 10.706822 0.1578457 0.2059236
##           pa       po   vgseng1   vgseng2   vgseng3 run rowname       NSE
## 21 0.2702434 1.629240 0.1842543 1.8194417 1.5448294   2    8808 -1.074148
## 11 0.4645812 1.096790 1.0888779 0.5387504 1.0425659   1    6863 -1.073988
## 51 0.6487253 1.808287 1.7071025 0.2770891 1.3544152   5    3835 -1.074428
## 41 0.7180613 1.197692 1.7033005 1.1561331 1.6906791   4    7950 -1.074795
## 61 0.9058496 1.332713 0.5317341 0.9110006 0.6218084   6    6577 -1.075504
## 31 0.7092941 1.862676 1.4071374 1.3870897 0.2884155   3    2476 -1.075433
##        lnNSE        KGE     smNSE    smlnNSE       smKGE    calNSE  callnNSE
## 21 -41.46555 -0.4665195 -7.404988 -11.765507 -0.09886063 -5.302700 -147.8225
## 11 -41.44601 -0.4608508 -1.937750  -2.261907 -0.13964486 -5.302334 -147.9313
## 51 -41.65685 -0.5009702 -6.759501 -11.005991 -0.16980764 -5.303775 -148.5624
## 41 -42.03889 -0.5122919 -4.564581  -6.885572 -0.28828748 -5.305189 -149.5275
## 61 -42.19785 -0.6276096 -4.644010  -7.195072 -0.22020833 -5.307964 -150.5135
## 31 -42.39366 -0.5626434 -6.779262 -11.330996 -0.23939092 -5.309801 -151.5727
##        calKGE  calsmNSE calsmlnNSE    calsmKGE    valNSE  vallnNSE     valKGE
## 21 -0.5009698 -7.404988 -11.765507 -0.09886063 -2.606863 -89.17992 -0.5372521
## 11 -0.4712902 -1.937750  -2.261907 -0.13964486 -2.606518 -89.10235 -0.4638593
## 51 -0.5090750 -6.759501 -11.005991 -0.16980764 -2.607620 -89.67716 -0.6287369
## 41 -0.4741126 -4.564581  -6.885572 -0.28828748 -2.608339 -90.19089 -0.6609060
## 61 -0.6139517 -4.644010  -7.195072 -0.22020833 -2.608640 -90.37677 -0.6983202
## 31 -0.6471590 -6.779262 -11.330996 -0.23939092 -2.608882 -90.55725 -0.5131821
##      valsmNSE valsmlnNSE   valsmKGE treatment weightedcal
## 21 -23.823269 -49.846647  0.2873930       RSS  -0.2999152
## 11  -5.891048  -9.123515  0.2571265       RSS  -0.3054675
## 51 -22.779159 -48.780093  0.1881849       RSS  -0.3394413
## 41 -15.719842 -31.739606 -0.1905734       RSS  -0.3812001
## 61 -16.766663 -34.621086 -0.1780992       RSS  -0.4170800
## 31 -23.985343 -52.300590  0.1359405       RSS  -0.4432749

RSS - prepare to run model n times for patch 1 - only for validation time series

setwd(system.file("extdata/", package = "RHESSysIOinR"))
getwd()
## [1] "C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata"
validationruns <- 6

input_rhessys = IOin_rhessys_input(
  version = rh_path,
  tec_file = "tecfiles/tec_daily",
  world_file = "CWWS32.world.Y2018M11D1H1.state.Y2018M11D1H1.state",
  world_hdr_prefix = "CWWS32",
  flowtable = "CWWS32.flow",
  start = "2015 11 1 1",
  end = "2018 11 1 1",
  output_folder = "out",
  output_prefix = "cwws32valrss1",
commandline_options = c(""))

input_tec_data = IOin_tec_std(start = "2017 11 1 1",
                              end = "2018 11 1 1",
                              output_state = FALSE)

input_hdr = IOin_hdr(
  basin = "defs/basin.def",
  hillslope = "defs/hillslope.def",
  zone = "defs/zone.def",
  soil = c("defs/soil_clay.def","defs/soil_clayloam.def","defs/soil_loam.def","defs/soil_loamysand.def","defs/soil_rock.def","defs/soil_sand.def","defs/soil_sandyclay.def","defs/soil_sandyclayloam.def","defs/soil_sandyloam.def","defs/soil_silt.def","defs/soil_siltyclay.def","defs/soil_siltyclayloam.def","defs/soil_siltyloam.def","defs/soil_water.def", "defs/soil_shallowloam.def", "defs/soil_shallowsandyclayloam.def", "defs/soil_shallowsandyloam.def"),
  landuse = "defs/lu_undev.def",
  stratum = c("defs/veg_deciduous/veg_deciduous.def","defs/veg_evergreen/veg_evergreen.def","defs/veg_deciduous_BES.def","defs/veg_eucalypt.def","defs/veg_grass.def","defs/veg_lawn_2cm.def","defs/veg_lawn_5cm.def","defs/veg_lawn_10cm.def","defs/veg_nonveg.def"),
  basestations = "clim/cwtws32local.base")

RSS - Run RHESSYs

setwd(system.file("extdata/", package = "RHESSysIOinR"))

n.cores <- parallel::detectCores() - 4  
  
my.cluster <- parallel::makeCluster(
    n.cores, 
    type = "PSOCK"
  )
doParallel::registerDoParallel(cl = my.cluster)

start_time = Sys.time()
  
  foreach(i = 1:validationruns, .packages = 'RHESSysIOinR') %dopar% {
    
    stdpars<- IOin_cmd_pars(m = toprss[i,]$m,
                            k = toprss[i,]$k,
                            soil_dep= toprss[i,]$soil_dep,
                            m_v = toprss[i,]$m_v,
                            k_v = toprss[i,]$k_v,
                            gw1 = toprss[i,]$gw1,
                            gw2 = toprss[i,]$gw2,
                            pa = toprss[i,]$pa,
                            po = toprss[i,]$po,
                            vgseng1 = toprss[i,]$vgseng1,
                            vgseng2 = toprss[i,]$vgseng2,
                            vgseng3 = toprss[i,]$vgseng3)
    
    run_rhessys_single(input_rhessys = input_rhessys,
                       hdr_files = input_hdr,
                       tec_data = input_tec_data,
                       cmd_pars = stdpars,
                       output_filter = c(patchfilterpatch1,patchfilterpatch2,patchfilterpatch3),
                       runID = i)
  } 
## [[1]]
## NULL
## 
## [[2]]
## NULL
## 
## [[3]]
## NULL
## 
## [[4]]
## NULL
## 
## [[5]]
## NULL
## 
## [[6]]
## NULL
  end_time = Sys.time()
  end_time - start_time
## Time difference of 3.397368 mins

##prepare data RSS - prepare site specific soil moisture datasets, make sure that each patch looks at this Site 2 at 60cm A was removed from the averaging because of no data

#Prepare observed Soil moisture data
obsws32smvalclean<- data.frame(obsws32smval$Date,obsws32smval$mergedsoilmoisture)
names(obsws32smvalclean)<- c('Date','mergedsoilmoisture')

obsws32smvalclean
##           Date mergedsoilmoisture
## 1   2017-12-17          0.1812803
## 2   2017-12-18          0.1813529
## 3   2017-12-19          0.1786329
## 4   2017-12-20          0.2045600
## 5   2017-12-21          0.2121985
## 6   2017-12-22          0.2034018
## 7   2017-12-23          0.2159135
## 8   2017-12-24          0.2180366
## 9   2017-12-25          0.2051297
## 10  2017-12-26          0.1967778
## 11  2017-12-27          0.1907229
## 12  2017-12-28          0.1860186
## 13  2017-12-29          0.1822263
## 14  2017-12-30          0.1789890
## 15  2017-12-31          0.1760297
## 16  2018-01-01          0.1730221
## 17  2018-01-02          0.1699094
## 18  2018-01-03          0.1674965
## 19  2018-01-04          0.1650735
## 20  2018-01-05          0.1623993
## 21  2018-01-06          0.1599766
## 22  2018-01-07          0.1576960
## 23  2018-01-08          0.1568914
## 24  2018-01-09          0.1574485
## 25  2018-01-10          0.1592184
## 26  2018-01-11          0.2106263
## 27  2018-01-12          0.2585713
## 28  2018-01-13          0.2298163
## 29  2018-01-14          0.2101749
## 30  2018-01-15          0.2000193
## 31  2018-01-16          0.1934378
## 32  2018-01-17          0.1884672
## 33  2018-01-18          0.1847465
## 34  2018-01-19          0.1827311
## 35  2018-01-20          0.1806938
## 36  2018-01-21          0.1788930
## 37  2018-01-22          0.1816379
## 38  2018-01-23          0.2099719
## 39  2018-01-24          0.2042055
## 40  2018-01-25          0.1978362
## 41  2018-01-26          0.1925960
## 42  2018-01-27          0.1913684
## 43  2018-01-28          0.2227986
## 44  2018-01-29          0.2251622
## 45  2018-01-30          0.2114195
## 46  2018-01-31          0.2024122
## 47  2018-02-01          0.1966335
## 48  2018-02-02          0.1958087
## 49  2018-02-03          0.1918223
## 50  2018-02-04          0.2215597
## 51  2018-02-05          0.2242181
## 52  2018-02-06          0.2119706
## 53  2018-02-07          0.2403602
## 54  2018-02-08          0.2277506
## 55  2018-02-09          0.2117093
## 56  2018-02-10          0.2263567
## 57  2018-02-11          0.2594152
## 58  2018-02-12          0.2177703
## 59  2018-02-13          0.2526821
## 60  2018-02-14          0.2187074
## 61  2018-02-15          0.2141866
## 62  2018-02-16          0.2078769
## 63  2018-02-17          0.2023741
## 64  2018-02-18          0.2103213
## 65  2018-02-19          0.2066506
## 66  2018-02-20          0.2011578
## 67  2018-02-21          0.2304523
## 68  2018-02-22          0.2259672
## 69  2018-02-23          0.2114646
## 70  2018-02-24          0.2029441
## 71  2018-02-25          0.2018564
## 72  2018-02-26          0.2042301
## 73  2018-02-27          0.1995574
## 74  2018-02-28          0.2057860
## 75  2018-03-01          0.2489119
## 76  2018-03-02          0.2292061
## 77  2018-03-03          0.2128520
## 78  2018-03-04          0.2033614
## 79  2018-03-05          0.1965865
## 80  2018-03-06          0.2052393
## 81  2018-03-07          0.2119353
## 82  2018-03-08          0.2067156
## 83  2018-03-09          0.2004845
## 84  2018-03-10          0.1957295
## 85  2018-03-11          0.1919861
## 86  2018-03-12          0.2025691
## 87  2018-03-13          0.2017443
## 88  2018-03-14          0.1974754
## 89  2018-03-15          0.1936638
## 90  2018-03-16          0.1900477
## 91  2018-03-17          0.1877393
## 92  2018-03-18          0.1905354
## 93  2018-03-19          0.1901329
## 94  2018-03-20          0.2072206
## 95  2018-03-21          0.2128883
## 96  2018-03-22          0.2075410
## 97  2018-03-23          0.2024549
## 98  2018-03-24          0.1993210
## 99  2018-03-25          0.2166313
## 100 2018-03-26          0.2121376
## 101 2018-03-27          0.2056414
## 102 2018-03-28          0.2002648
## 103 2018-03-29          0.2006057
## 104 2018-03-30          0.2255177
## 105 2018-03-31          0.2150303
## 106 2018-04-01          0.2069646
## 107 2018-04-02          0.2005587
## 108 2018-04-03          0.1953756
## 109 2018-04-04          0.1962923
## 110 2018-04-05          0.1934653
## 111 2018-04-06          0.1907393
## 112 2018-04-07          0.2162749
## 113 2018-04-08          0.2142361
## 114 2018-04-09          0.2083649
## 115 2018-04-10          0.2035641
## 116 2018-04-11          0.1985177
## 117 2018-04-12          0.1938879
## 118 2018-04-13          0.1897607
## 119 2018-04-14          0.1861888
## 120 2018-04-15          0.2267652
## 121 2018-04-16          0.2352825
## 122 2018-04-17          0.2187042
## 123 2018-04-18          0.2088741
## 124 2018-04-19          0.2016534
## 125 2018-04-20          0.1961351
## 126 2018-04-21          0.1915013
## 127 2018-04-22          0.1883138
## 128 2018-04-23          0.2570006
## 129 2018-04-24          0.2662503
## 130 2018-04-25          0.2356152
## 131 2018-04-26          0.2246237
## 132 2018-04-27          0.2251174
## 133 2018-04-28          0.2142165
## 134 2018-04-29          0.2061856
## 135 2018-04-30          0.1998873
## 136 2018-05-01          0.1946701
## 137 2018-05-02          0.1905331
## 138 2018-05-03          0.1862787
## 139 2018-05-04          0.1821768
## 140 2018-05-05          0.1787459
## 141 2018-05-06          0.1771430
## 142 2018-05-07          0.1816304
## 143 2018-05-08          0.1969321
## 144 2018-05-09          0.1949738
## 145 2018-05-10          0.1898592
## 146 2018-05-11          0.1844252
## 147 2018-05-12          0.1788747
## 148 2018-05-13          0.1733239
## 149 2018-05-14          0.1679975
## 150 2018-05-15          0.1646196
obsws32smvalclean$Site3<- rowMeans(subset(obsws32smval, select = c(smois30site3a,smois60site3a,smois30site3b,smois60site3b), na.rm = TRUE))
obsws32smvalclean$Site2<- rowMeans(subset(obsws32smval, select = c(smois30site2a,smois30site2b,smois60site2b), na.rm = TRUE))
obsws32smvalclean$Site1<- rowMeans(subset(obsws32smval, select = c(smois30site1a,smois60site1a,smois30site1b,smois60site1b), na.rm = TRUE))

obsws32smvalclean
##           Date mergedsoilmoisture     Site3     Site2     Site1
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696
plot(obsws32smvalclean$Date,obsws32smvalclean$Site3, type = "l", main = "SITE 3 Averaged Sensor Output")

obsws32smvalclean$Site3
##   [1] 0.2184210 0.2184097 0.2147977 0.2352214 0.2435130 0.2369948 0.2474115
##   [8] 0.2508741 0.2392457 0.2311780 0.2253247 0.2206840 0.2169158 0.2136771
##  [15] 0.2104852 0.2068863 0.2026606 0.1998021 0.1969184 0.1935668 0.1904905
##  [22] 0.1877726 0.1872422 0.1894384 0.1939688 0.2476406 0.3023993 0.2697049
##  [29] 0.2461050 0.2340321 0.2271962 0.2222873 0.2177543 0.2160347 0.2148377
##  [36] 0.2141354 0.2176727 0.2426632 0.2377882 0.2319010 0.2267535 0.2261970
##  [43] 0.2548967 0.2590182 0.2458255 0.2366563 0.2307604 0.2303811 0.2255894
##  [50] 0.2586415 0.2588863 0.2460191 0.2747222 0.2657526 0.2479861 0.2620903
##  [57]        NA        NA 0.3420382 0.2685182 0.2565538 0.2455486 0.2391111
##  [64] 0.2463655 0.2421328 0.2357995 0.2652378 0.2614158 0.2466120 0.2381710
##  [71] 0.2393038 0.2415321 0.2352457 0.2428750 0.2840321 0.2686840 0.2514045
##  [78] 0.2409384 0.2332422 0.2435052 0.2464280 0.2389826 0.2327387 0.2281016
##  [85] 0.2243811 0.2368247 0.2339063 0.2298194 0.2264358 0.2228429 0.2206745
##  [92] 0.2259635 0.2256233 0.2431823 0.2453212 0.2405356 0.2355833 0.2326936
##  [99] 0.2498394 0.2440990 0.2378082 0.2323446 0.2330764 0.2530920 0.2447335
## [106] 0.2373377 0.2311814 0.2262899 0.2295095 0.2269696 0.2251259 0.2500877
## [113] 0.2459740 0.2414036 0.2366189 0.2312960 0.2266094 0.2225330 0.2190686
## [120] 0.2573394 0.2709479 0.2539436 0.2433733 0.2354809 0.2297092 0.2250877
## [127] 0.2221033 0.2928273 0.3156189 0.2778342 0.2655755 0.2625469 0.2513707
## [134] 0.2437292 0.2375208 0.2322135 0.2286172 0.2238941 0.2190781 0.2156814
## [141] 0.2143819 0.2184427 0.2361970 0.2357708 0.2300799 0.2234852 0.2176962
## [148] 0.2124896 0.2079583 0.2067674
{plot(obsws32smvalclean$Date,obsws32smvalclean$mergedsoilmoisture, type = "l", main = "All site averaged sensor output", lty = 3, lwd = 2, ylim = c(0.10,0.35))
lines(obsws32smvalclean$Date,obsws32smvalclean$Site1, col = 'BLUE')
lines(obsws32smvalclean$Date,obsws32smvalclean$Site2, col = 'RED')
lines(obsws32smvalclean$Date,obsws32smvalclean$Site3, col = 'GREEN')}

# must modify vwc calculation to use * instead of / RSS - read 20 runs, create table and append to table for site 1

# Read in RHESSys Validation runs

setwd(system.file("extdata/", package = "RHESSysIOinR"))


#create rootzonevwc column
for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch1_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valrss1_run",i),temp_dataset)
}

##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valrss1_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}


valmergesm1
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    112 136557  136557   0.301038               0.122944
## 2         1    112 136557  136557   0.301231               0.122944
## 3         1    112 136557  136557   0.240824               0.122944
## 4         1    112 136557  136557   0.367783               0.122944
## 5         1    112 136557  136557   0.238428               0.122944
## 6         1    112 136557  136557   0.275800               0.122944
## 7         1    112 136557  136557   0.374852               0.122944
## 8         1    112 136557  136557   0.235569               0.122944
## 9         1    112 136557  136557   0.211294               0.122944
## 10        1    112 136557  136557   0.194873               0.122944
## 11        1    112 136557  136557   0.182629               0.122944
## 12        1    112 136557  136557   0.172977               0.122944
## 13        1    112 136557  136557   0.165082               0.122944
## 14        1    112 136557  136557   0.158453               0.122944
## 15        1    112 136557  136557   0.152775               0.122944
## 16        1    112 136557  136557   0.147836               0.122944
## 17        1    112 136557  136557   0.143484               0.122944
## 18        1    112 136557  136557   0.139612               0.122944
## 19        1    112 136557  136557   0.136135               0.122944
## 20        1    112 136557  136557   0.132991               0.122944
## 21        1    112 136557  136557   0.130130               0.122944
## 22        1    112 136557  136557   0.127511               0.122944
## 23        1    112 136557  136557   0.135434               0.122944
## 24        1    112 136557  136557   0.132349               0.122944
## 25        1    112 136557  136557   0.153208               0.122944
## 26        1    112 136557  136557   0.259786               0.122944
## 27        1    112 136557  136557   0.325588               0.122944
## 28        1    112 136557  136557   0.245238               0.122944
## 29        1    112 136557  136557   0.217328               0.122944
## 30        1    112 136557  136557   0.199208               0.122944
## 31        1    112 136557  136557   0.203699               0.122944
## 32        1    112 136557  136557   0.189351               0.122944
## 33        1    112 136557  136557   0.178345               0.122944
## 34        1    112 136557  136557   0.169508               0.122944
## 35        1    112 136557  136557   0.162186               0.122944
## 36        1    112 136557  136557   0.155978               0.122944
## 37        1    112 136557  136557   0.331353               0.122944
## 38        1    112 136557  136557   0.324458               0.122944
## 39        1    112 136557  136557   0.245214               0.122944
## 40        1    112 136557  136557   0.217332               0.122944
## 41        1    112 136557  136557   0.199223               0.122944
## 42        1    112 136557  136557   0.292065               0.122944
## 43        1    112 136557  136557   0.352505               0.122944
## 44        1    112 136557  136557   0.243682               0.122944
## 45        1    112 136557  136557   0.216428               0.122944
## 46        1    112 136557  136557   0.198594               0.122944
## 47        1    112 136557  136557   0.219371               0.122944
## 48        1    112 136557  136557   0.200653               0.122944
## 49        1    112 136557  136557   0.187078               0.122944
## 50        1    112 136557  136557   0.374813               0.122944
## 51        1    112 136557  136557   0.236560               0.122944
## 52        1    112 136557  136557   0.249304               0.122944
## 53        1    112 136557  136557   0.259786               0.122944
## 54        1    112 136557  136557   0.225594               0.122944
## 55        1    112 136557  136557   0.204910               0.122944
## 56        1    112 136557  136557   0.259786               0.122944
## 57        1    112 136557  136557   0.259786               0.122944
## 58        1    112 136557  136557   0.329259               0.122944
## 59        1    112 136557  136557   0.337580               0.122944
## 60        1    112 136557  136557   0.244996               0.122944
## 61        1    112 136557  136557   0.295821               0.122944
## 62        1    112 136557  136557   0.239358               0.122944
## 63        1    112 136557  136557   0.319913               0.122944
## 64        1    112 136557  136557   0.328118               0.122944
## 65        1    112 136557  136557   0.328870               0.122944
## 66        1    112 136557  136557   0.334725               0.122944
## 67        1    112 136557  136557   0.259786               0.122944
## 68        1    112 136557  136557   0.225191               0.122944
## 69        1    112 136557  136557   0.204437               0.122944
## 70        1    112 136557  136557   0.205932               0.122944
## 71        1    112 136557  136557   0.270898               0.122944
## 72        1    112 136557  136557   0.293807               0.122944
## 73        1    112 136557  136557   0.238364               0.122944
## 74        1    112 136557  136557   0.371390               0.122944
## 75        1    112 136557  136557   0.259786               0.122944
## 76        1    112 136557  136557   0.225071               0.122944
## 77        1    112 136557  136557   0.204308               0.122944
## 78        1    112 136557  136557   0.189696               0.122944
## 79        1    112 136557  136557   0.178575               0.122944
## 80        1    112 136557  136557   0.298320               0.122944
## 81        1    112 136557  136557   0.301813               0.122944
## 82        1    112 136557  136557   0.240353               0.122944
## 83        1    112 136557  136557   0.214024               0.122944
## 84        1    112 136557  136557   0.196709               0.122944
## 85        1    112 136557  136557   0.215880               0.122944
## 86        1    112 136557  136557   0.288136               0.122944
## 87        1    112 136557  136557   0.282816               0.122944
## 88        1    112 136557  136557   0.278567               0.122944
## 89        1    112 136557  136557   0.272651               0.122944
## 90        1    112 136557  136557   0.267500               0.122944
## 91        1    112 136557  136557   0.317136               0.122944
## 92        1    112 136557  136557   0.306904               0.122944
## 93        1    112 136557  136557   0.373899               0.122944
## 94        1    112 136557  136557   0.374589               0.122944
## 95        1    112 136557  136557   0.351574               0.122944
## 96        1    112 136557  136557   0.333770               0.122944
## 97        1    112 136557  136557   0.320640               0.122944
## 98        1    112 136557  136557   0.373175               0.122944
## 99        1    112 136557  136557   0.371344               0.122944
## 100       1    112 136557  136557   0.345971               0.122944
## 101       1    112 136557  136557   0.330066               0.122944
## 102       1    112 136557  136557   0.317491               0.122944
## 103       1    112 136557  136557   0.342676               0.122944
## 104       1    112 136557  136557   0.327000               0.122944
## 105       1    112 136557  136557   0.314942               0.122944
## 106       1    112 136557  136557   0.304752               0.122944
## 107       1    112 136557  136557   0.296160               0.122944
## 108       1    112 136557  136557   0.289339               0.122944
## 109       1    112 136557  136557   0.320132               0.122944
## 110       1    112 136557  136557   0.308896               0.122944
## 111       1    112 136557  136557   0.340705               0.122944
## 112       1    112 136557  136557   0.360158               0.122944
## 113       1    112 136557  136557   0.338867               0.122944
## 114       1    112 136557  136557   0.341477               0.122944
## 115       1    112 136557  136557   0.326295               0.122944
## 116       1    112 136557  136557   0.314368               0.122944
## 117       1    112 136557  136557   0.304203               0.122944
## 118       1    112 136557  136557   0.296095               0.122944
## 119       1    112 136557  136557   0.289710               0.122944
## 120       1    112 136557  136557   0.259786               0.122944
## 121       1    112 136557  136557   0.258972               0.122944
## 122       1    112 136557  136557   0.253961               0.122944
## 123       1    112 136557  136557   0.248820               0.122944
## 124       1    112 136557  136557   0.245268               0.122944
## 125       1    112 136557  136557   0.240577               0.122944
## 126       1    112 136557  136557   0.237481               0.122944
## 127       1    112 136557  136557   0.270204               0.122944
## 128       1    112 136557  136557   0.259786               0.122944
## 129       1    112 136557  136557   0.373360               0.122944
## 130       1    112 136557  136557   0.346774               0.122944
## 131       1    112 136557  136557   0.369188               0.122944
## 132       1    112 136557  136557   0.343377               0.122944
## 133       1    112 136557  136557   0.326765               0.122944
## 134       1    112 136557  136557   0.314421               0.122944
## 135       1    112 136557  136557   0.303373               0.122944
## 136       1    112 136557  136557   0.293644               0.122944
## 137       1    112 136557  136557   0.285648               0.122944
## 138       1    112 136557  136557   0.278062               0.122944
## 139       1    112 136557  136557   0.270697               0.122944
## 140       1    112 136557  136557   0.266089               0.122944
## 141       1    112 136557  136557   0.279990               0.122944
## 142       1    112 136557  136557   0.368586               0.122944
## 143       1    112 136557  136557   0.365226               0.122944
## 144       1    112 136557  136557   0.345356               0.122944
## 145       1    112 136557  136557   0.334258               0.122944
## 146       1    112 136557  136557   0.319306               0.122944
## 147       1    112 136557  136557   0.307252               0.122944
## 148       1    112 136557  136557   0.296874               0.122944
## 149       1    112 136557  136557   0.287809               0.122944
## 150       1    112 136557  136557   0.344881               0.122944
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.031939   0.037011  0.03701082
## 2                  0.031939   0.037034  0.03703454
## 3                  0.031939   0.029608  0.02960787
## 4                  0.031939   0.045217  0.04521671
## 5                  0.031939   0.029313  0.02931329
## 6                  0.031939   0.033908  0.03390796
## 7                  0.031939   0.046086  0.04608580
## 8                  0.031939   0.028962  0.02896180
## 9                  0.031939   0.025977  0.02597733
## 10                 0.031939   0.023958  0.02395847
## 11                 0.031939   0.022453  0.02245314
## 12                 0.031939   0.021266  0.02126648
## 13                 0.031939   0.020296  0.02029584
## 14                 0.031939   0.019481  0.01948085
## 15                 0.031939   0.018783  0.01878277
## 16                 0.031939   0.018175  0.01817555
## 17                 0.031939   0.017640  0.01764050
## 18                 0.031939   0.017164  0.01716446
## 19                 0.031939   0.016737  0.01673698
## 20                 0.031939   0.016350  0.01635045
## 21                 0.031939   0.015999  0.01599870
## 22                 0.031939   0.015677  0.01567671
## 23                 0.031939   0.016651  0.01665080
## 24                 0.031939   0.016271  0.01627152
## 25                 0.031939   0.018836  0.01883600
## 26                 0.031939   0.031939  0.03193913
## 27                 0.031939   0.040029  0.04002909
## 28                 0.031939   0.030150  0.03015054
## 29                 0.031939   0.026719  0.02671917
## 30                 0.031939   0.024491  0.02449143
## 31                 0.031939   0.025043  0.02504357
## 32                 0.031939   0.023279  0.02327957
## 33                 0.031939   0.021926  0.02192645
## 34                 0.031939   0.020840  0.02083999
## 35                 0.031939   0.019940  0.01993980
## 36                 0.031939   0.019177  0.01917656
## 37                 0.031939   0.040738  0.04073786
## 38                 0.031939   0.039890  0.03989016
## 39                 0.031939   0.030147  0.03014759
## 40                 0.031939   0.026720  0.02671967
## 41                 0.031939   0.024493  0.02449327
## 42                 0.031939   0.035907  0.03590764
## 43                 0.031939   0.043338  0.04333837
## 44                 0.031939   0.029959  0.02995924
## 45                 0.031939   0.026608  0.02660852
## 46                 0.031939   0.024416  0.02441594
## 47                 0.031939   0.026970  0.02697035
## 48                 0.031939   0.024669  0.02466908
## 49                 0.031939   0.023000  0.02300012
## 50                 0.031939   0.046081  0.04608101
## 51                 0.031939   0.029084  0.02908363
## 52                 0.031939   0.030650  0.03065043
## 53                 0.031939   0.031939  0.03193913
## 54                 0.031939   0.027735  0.02773543
## 55                 0.031939   0.025192  0.02519246
## 56                 0.031939   0.031939  0.03193913
## 57                 0.031939   0.031939  0.03193913
## 58                 0.031939   0.040480  0.04048042
## 59                 0.031939   0.041503  0.04150344
## 60                 0.031939   0.030121  0.03012079
## 61                 0.031939   0.036369  0.03636942
## 62                 0.031939   0.029427  0.02942763
## 63                 0.031939   0.039331  0.03933138
## 64                 0.031939   0.040340  0.04034014
## 65                 0.031939   0.040432  0.04043259
## 66                 0.031939   0.041152  0.04115243
## 67                 0.031939   0.031939  0.03193913
## 68                 0.031939   0.027686  0.02768588
## 69                 0.031939   0.025134  0.02513430
## 70                 0.031939   0.025318  0.02531810
## 71                 0.031939   0.033305  0.03330528
## 72                 0.031939   0.036122  0.03612181
## 73                 0.031939   0.029305  0.02930542
## 74                 0.031939   0.045660  0.04566017
## 75                 0.031939   0.031939  0.03193913
## 76                 0.031939   0.027671  0.02767113
## 77                 0.031939   0.025118  0.02511844
## 78                 0.031939   0.023322  0.02332199
## 79                 0.031939   0.021955  0.02195472
## 80                 0.031939   0.036676  0.03667665
## 81                 0.031939   0.037106  0.03710610
## 82                 0.031939   0.029550  0.02954996
## 83                 0.031939   0.026313  0.02631297
## 84                 0.031939   0.024184  0.02418419
## 85                 0.031939   0.026541  0.02654115
## 86                 0.031939   0.035424  0.03542459
## 87                 0.031939   0.034770  0.03477053
## 88                 0.031939   0.034248  0.03424814
## 89                 0.031939   0.033521  0.03352080
## 90                 0.031939   0.032887  0.03288752
## 91                 0.031939   0.038990  0.03898997
## 92                 0.031939   0.037732  0.03773201
## 93                 0.031939   0.045968  0.04596864
## 94                 0.031939   0.046053  0.04605347
## 95                 0.031939   0.043224  0.04322391
## 96                 0.031939   0.041035  0.04103502
## 97                 0.031939   0.039421  0.03942076
## 98                 0.031939   0.045879  0.04587963
## 99                 0.031939   0.045654  0.04565452
## 100                0.031939   0.042535  0.04253506
## 101                0.031939   0.040579  0.04057963
## 102                0.031939   0.039033  0.03903361
## 103                0.031939   0.042130  0.04212996
## 104                0.031939   0.040203  0.04020269
## 105                0.031939   0.038720  0.03872023
## 106                0.031939   0.037467  0.03746743
## 107                0.031939   0.036411  0.03641110
## 108                0.031939   0.035572  0.03557249
## 109                0.031939   0.039358  0.03935831
## 110                0.031939   0.037977  0.03797691
## 111                0.031939   0.041887  0.04188764
## 112                0.031939   0.044279  0.04427927
## 113                0.031939   0.041661  0.04166166
## 114                0.031939   0.041982  0.04198255
## 115                0.031939   0.040116  0.04011601
## 116                0.031939   0.038650  0.03864966
## 117                0.031939   0.037400  0.03739993
## 118                0.031939   0.036403  0.03640310
## 119                0.031939   0.035618  0.03561811
## 120                0.031939   0.031939  0.03193913
## 121                0.031939   0.031839  0.03183905
## 122                0.031939   0.031223  0.03122298
## 123                0.031939   0.030591  0.03059093
## 124                0.031939   0.030154  0.03015423
## 125                0.031939   0.029577  0.02957750
## 126                0.031939   0.029197  0.02919686
## 127                0.031939   0.033220  0.03321996
## 128                0.031939   0.031939  0.03193913
## 129                0.031939   0.045902  0.04590237
## 130                0.031939   0.042634  0.04263378
## 131                0.031939   0.045389  0.04538945
## 132                0.031939   0.042216  0.04221614
## 133                0.031939   0.040174  0.04017380
## 134                0.031939   0.038656  0.03865618
## 135                0.031939   0.037298  0.03729789
## 136                0.031939   0.036102  0.03610177
## 137                0.031939   0.035119  0.03511871
## 138                0.031939   0.034186  0.03418605
## 139                0.031939   0.033280  0.03328057
## 140                0.031939   0.032714  0.03271405
## 141                0.031939   0.034423  0.03442309
## 142                0.031939   0.045315  0.04531544
## 143                0.031939   0.044902  0.04490235
## 144                0.031939   0.042459  0.04245945
## 145                0.031939   0.041095  0.04109502
## 146                0.031939   0.039257  0.03925676
## 147                0.031939   0.037775  0.03777479
## 148                0.031939   0.036499  0.03649888
## 149                0.031939   0.035384  0.03538439
## 150                0.031939   0.042401  0.04240105
validationsmNSElistsite1<- c()
validationsmlnNSElistsite1<- c()
validationsmKGElistsite1<- c()


#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site1"))))))
  validationsmKGElistsite1[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


validationsmKGElistsite1
## [[1]]
## [1] -0.1572728
## 
## [[2]]
## [1] 0.009899872
## 
## [[3]]
## [1] -0.1492581
## 
## [[4]]
## [1] -0.05058916
## 
## [[5]]
## [1] -0.06016045
## 
## [[6]]
## [1] -0.2615479

RSS - Explore Site 1

'Exploring Site 1 RSS'
## [1] "Exploring Site 1 RSS"
cwws32valrss1_run1
##     day month year basinID hillID zoneID patchID rootzone.S
## 1     1    11 2017       1    112 136557  136557   0.227767
## 2     2    11 2017       1    112 136557  136557   0.205994
## 3     3    11 2017       1    112 136557  136557   0.190907
## 4     4    11 2017       1    112 136557  136557   0.179528
## 5     5    11 2017       1    112 136557  136557   0.170499
## 6     6    11 2017       1    112 136557  136557   0.171994
## 7     7    11 2017       1    112 136557  136557   0.298280
## 8     8    11 2017       1    112 136557  136557   0.297325
## 9     9    11 2017       1    112 136557  136557   0.305418
## 10   10    11 2017       1    112 136557  136557   0.240849
## 11   11    11 2017       1    112 136557  136557   0.214236
## 12   12    11 2017       1    112 136557  136557   0.263235
## 13   13    11 2017       1    112 136557  136557   0.263482
## 14   14    11 2017       1    112 136557  136557   0.226134
## 15   15    11 2017       1    112 136557  136557   0.204957
## 16   16    11 2017       1    112 136557  136557   0.190159
## 17   17    11 2017       1    112 136557  136557   0.178938
## 18   18    11 2017       1    112 136557  136557   0.278860
## 19   19    11 2017       1    112 136557  136557   0.278206
## 20   20    11 2017       1    112 136557  136557   0.232700
## 21   21    11 2017       1    112 136557  136557   0.234196
## 22   22    11 2017       1    112 136557  136557   0.210207
## 23   23    11 2017       1    112 136557  136557   0.193991
## 24   24    11 2017       1    112 136557  136557   0.181910
## 25   25    11 2017       1    112 136557  136557   0.172396
## 26   26    11 2017       1    112 136557  136557   0.164622
## 27   27    11 2017       1    112 136557  136557   0.158100
## 28   28    11 2017       1    112 136557  136557   0.152520
## 29   29    11 2017       1    112 136557  136557   0.147670
## 30   30    11 2017       1    112 136557  136557   0.165234
## 31    1    12 2017       1    112 136557  136557   0.158611
## 32    2    12 2017       1    112 136557  136557   0.152951
## 33    3    12 2017       1    112 136557  136557   0.148036
## 34    4    12 2017       1    112 136557  136557   0.143714
## 35    5    12 2017       1    112 136557  136557   0.289718
## 36    6    12 2017       1    112 136557  136557   0.237198
## 37    7    12 2017       1    112 136557  136557   0.212197
## 38    8    12 2017       1    112 136557  136557   0.195463
## 39    9    12 2017       1    112 136557  136557   0.183058
## 40   10    12 2017       1    112 136557  136557   0.173315
## 41   11    12 2017       1    112 136557  136557   0.165367
## 42   12    12 2017       1    112 136557  136557   0.217888
## 43   13    12 2017       1    112 136557  136557   0.199494
## 44   14    12 2017       1    112 136557  136557   0.186136
## 45   15    12 2017       1    112 136557  136557   0.198298
## 46   16    12 2017       1    112 136557  136557   0.291621
## 47   17    12 2017       1    112 136557  136557   0.301038
## 48   18    12 2017       1    112 136557  136557   0.301231
## 49   19    12 2017       1    112 136557  136557   0.240824
## 50   20    12 2017       1    112 136557  136557   0.367783
## 51   21    12 2017       1    112 136557  136557   0.238428
## 52   22    12 2017       1    112 136557  136557   0.275800
## 53   23    12 2017       1    112 136557  136557   0.374852
## 54   24    12 2017       1    112 136557  136557   0.235569
## 55   25    12 2017       1    112 136557  136557   0.211294
## 56   26    12 2017       1    112 136557  136557   0.194873
## 57   27    12 2017       1    112 136557  136557   0.182629
## 58   28    12 2017       1    112 136557  136557   0.172977
## 59   29    12 2017       1    112 136557  136557   0.165082
## 60   30    12 2017       1    112 136557  136557   0.158453
## 61   31    12 2017       1    112 136557  136557   0.152775
## 62    1     1 2018       1    112 136557  136557   0.147836
## 63    2     1 2018       1    112 136557  136557   0.143484
## 64    3     1 2018       1    112 136557  136557   0.139612
## 65    4     1 2018       1    112 136557  136557   0.136135
## 66    5     1 2018       1    112 136557  136557   0.132991
## 67    6     1 2018       1    112 136557  136557   0.130130
## 68    7     1 2018       1    112 136557  136557   0.127511
## 69    8     1 2018       1    112 136557  136557   0.135434
## 70    9     1 2018       1    112 136557  136557   0.132349
## 71   10     1 2018       1    112 136557  136557   0.153208
## 72   11     1 2018       1    112 136557  136557   0.259786
## 73   12     1 2018       1    112 136557  136557   0.325588
## 74   13     1 2018       1    112 136557  136557   0.245238
## 75   14     1 2018       1    112 136557  136557   0.217328
## 76   15     1 2018       1    112 136557  136557   0.199208
## 77   16     1 2018       1    112 136557  136557   0.203699
## 78   17     1 2018       1    112 136557  136557   0.189351
## 79   18     1 2018       1    112 136557  136557   0.178345
## 80   19     1 2018       1    112 136557  136557   0.169508
## 81   20     1 2018       1    112 136557  136557   0.162186
## 82   21     1 2018       1    112 136557  136557   0.155978
## 83   22     1 2018       1    112 136557  136557   0.331353
## 84   23     1 2018       1    112 136557  136557   0.324458
## 85   24     1 2018       1    112 136557  136557   0.245214
## 86   25     1 2018       1    112 136557  136557   0.217332
## 87   26     1 2018       1    112 136557  136557   0.199223
## 88   27     1 2018       1    112 136557  136557   0.292065
## 89   28     1 2018       1    112 136557  136557   0.352505
## 90   29     1 2018       1    112 136557  136557   0.243682
## 91   30     1 2018       1    112 136557  136557   0.216428
## 92   31     1 2018       1    112 136557  136557   0.198594
## 93    1     2 2018       1    112 136557  136557   0.219371
## 94    2     2 2018       1    112 136557  136557   0.200653
## 95    3     2 2018       1    112 136557  136557   0.187078
## 96    4     2 2018       1    112 136557  136557   0.374813
## 97    5     2 2018       1    112 136557  136557   0.236560
## 98    6     2 2018       1    112 136557  136557   0.249304
## 99    7     2 2018       1    112 136557  136557   0.259786
## 100   8     2 2018       1    112 136557  136557   0.225594
## 101   9     2 2018       1    112 136557  136557   0.204910
## 102  10     2 2018       1    112 136557  136557   0.259786
## 103  11     2 2018       1    112 136557  136557   0.259786
## 104  12     2 2018       1    112 136557  136557   0.329259
## 105  13     2 2018       1    112 136557  136557   0.337580
## 106  14     2 2018       1    112 136557  136557   0.244996
## 107  15     2 2018       1    112 136557  136557   0.295821
## 108  16     2 2018       1    112 136557  136557   0.239358
## 109  17     2 2018       1    112 136557  136557   0.319913
## 110  18     2 2018       1    112 136557  136557   0.328118
## 111  19     2 2018       1    112 136557  136557   0.328870
## 112  20     2 2018       1    112 136557  136557   0.334725
## 113  21     2 2018       1    112 136557  136557   0.259786
## 114  22     2 2018       1    112 136557  136557   0.225191
## 115  23     2 2018       1    112 136557  136557   0.204437
## 116  24     2 2018       1    112 136557  136557   0.205932
## 117  25     2 2018       1    112 136557  136557   0.270898
## 118  26     2 2018       1    112 136557  136557   0.293807
## 119  27     2 2018       1    112 136557  136557   0.238364
## 120  28     2 2018       1    112 136557  136557   0.371390
## 121   1     3 2018       1    112 136557  136557   0.259786
## 122   2     3 2018       1    112 136557  136557   0.225071
## 123   3     3 2018       1    112 136557  136557   0.204308
## 124   4     3 2018       1    112 136557  136557   0.189696
## 125   5     3 2018       1    112 136557  136557   0.178575
## 126   6     3 2018       1    112 136557  136557   0.298320
## 127   7     3 2018       1    112 136557  136557   0.301813
## 128   8     3 2018       1    112 136557  136557   0.240353
## 129   9     3 2018       1    112 136557  136557   0.214024
## 130  10     3 2018       1    112 136557  136557   0.196709
## 131  11     3 2018       1    112 136557  136557   0.215880
## 132  12     3 2018       1    112 136557  136557   0.288136
## 133  13     3 2018       1    112 136557  136557   0.282816
## 134  14     3 2018       1    112 136557  136557   0.278567
## 135  15     3 2018       1    112 136557  136557   0.272651
## 136  16     3 2018       1    112 136557  136557   0.267500
## 137  17     3 2018       1    112 136557  136557   0.317136
## 138  18     3 2018       1    112 136557  136557   0.306904
## 139  19     3 2018       1    112 136557  136557   0.373899
## 140  20     3 2018       1    112 136557  136557   0.374589
## 141  21     3 2018       1    112 136557  136557   0.351574
## 142  22     3 2018       1    112 136557  136557   0.333770
## 143  23     3 2018       1    112 136557  136557   0.320640
## 144  24     3 2018       1    112 136557  136557   0.373175
## 145  25     3 2018       1    112 136557  136557   0.371344
## 146  26     3 2018       1    112 136557  136557   0.345971
## 147  27     3 2018       1    112 136557  136557   0.330066
## 148  28     3 2018       1    112 136557  136557   0.317491
## 149  29     3 2018       1    112 136557  136557   0.342676
## 150  30     3 2018       1    112 136557  136557   0.327000
## 151  31     3 2018       1    112 136557  136557   0.314942
## 152   1     4 2018       1    112 136557  136557   0.304752
## 153   2     4 2018       1    112 136557  136557   0.296160
## 154   3     4 2018       1    112 136557  136557   0.289339
## 155   4     4 2018       1    112 136557  136557   0.320132
## 156   5     4 2018       1    112 136557  136557   0.308896
## 157   6     4 2018       1    112 136557  136557   0.340705
## 158   7     4 2018       1    112 136557  136557   0.360158
## 159   8     4 2018       1    112 136557  136557   0.338867
## 160   9     4 2018       1    112 136557  136557   0.341477
## 161  10     4 2018       1    112 136557  136557   0.326295
## 162  11     4 2018       1    112 136557  136557   0.314368
## 163  12     4 2018       1    112 136557  136557   0.304203
## 164  13     4 2018       1    112 136557  136557   0.296095
## 165  14     4 2018       1    112 136557  136557   0.289710
## 166  15     4 2018       1    112 136557  136557   0.259786
## 167  16     4 2018       1    112 136557  136557   0.258972
## 168  17     4 2018       1    112 136557  136557   0.253961
## 169  18     4 2018       1    112 136557  136557   0.248820
## 170  19     4 2018       1    112 136557  136557   0.245268
## 171  20     4 2018       1    112 136557  136557   0.240577
## 172  21     4 2018       1    112 136557  136557   0.237481
## 173  22     4 2018       1    112 136557  136557   0.270204
## 174  23     4 2018       1    112 136557  136557   0.259786
## 175  24     4 2018       1    112 136557  136557   0.373360
## 176  25     4 2018       1    112 136557  136557   0.346774
## 177  26     4 2018       1    112 136557  136557   0.369188
## 178  27     4 2018       1    112 136557  136557   0.343377
## 179  28     4 2018       1    112 136557  136557   0.326765
## 180  29     4 2018       1    112 136557  136557   0.314421
## 181  30     4 2018       1    112 136557  136557   0.303373
## 182   1     5 2018       1    112 136557  136557   0.293644
## 183   2     5 2018       1    112 136557  136557   0.285648
## 184   3     5 2018       1    112 136557  136557   0.278062
## 185   4     5 2018       1    112 136557  136557   0.270697
## 186   5     5 2018       1    112 136557  136557   0.266089
## 187   6     5 2018       1    112 136557  136557   0.279990
## 188   7     5 2018       1    112 136557  136557   0.368586
## 189   8     5 2018       1    112 136557  136557   0.365226
## 190   9     5 2018       1    112 136557  136557   0.345356
## 191  10     5 2018       1    112 136557  136557   0.334258
## 192  11     5 2018       1    112 136557  136557   0.319306
## 193  12     5 2018       1    112 136557  136557   0.307252
## 194  13     5 2018       1    112 136557  136557   0.296874
## 195  14     5 2018       1    112 136557  136557   0.287809
## 196  15     5 2018       1    112 136557  136557   0.344881
## 197  16     5 2018       1    112 136557  136557   0.259786
## 198  17     5 2018       1    112 136557  136557   0.259786
## 199  18     5 2018       1    112 136557  136557   0.301783
## 200  19     5 2018       1    112 136557  136557   0.367678
## 201  20     5 2018       1    112 136557  136557   0.347664
## 202  21     5 2018       1    112 136557  136557   0.328910
## 203  22     5 2018       1    112 136557  136557   0.297606
## 204  23     5 2018       1    112 136557  136557   0.294700
## 205  24     5 2018       1    112 136557  136557   0.286632
## 206  25     5 2018       1    112 136557  136557   0.321580
## 207  26     5 2018       1    112 136557  136557   0.259786
## 208  27     5 2018       1    112 136557  136557   0.324652
## 209  28     5 2018       1    112 136557  136557   0.259786
## 210  29     5 2018       1    112 136557  136557   0.259786
## 211  30     5 2018       1    112 136557  136557   0.259786
## 212  31     5 2018       1    112 136557  136557   0.271082
## 213   1     6 2018       1    112 136557  136557   0.291858
## 214   2     6 2018       1    112 136557  136557   0.283603
## 215   3     6 2018       1    112 136557  136557   0.276029
## 216   4     6 2018       1    112 136557  136557   0.268963
## 217   5     6 2018       1    112 136557  136557   0.262283
## 218   6     6 2018       1    112 136557  136557   0.257919
## 219   7     6 2018       1    112 136557  136557   0.254140
## 220   8     6 2018       1    112 136557  136557   0.250316
## 221   9     6 2018       1    112 136557  136557   0.246447
## 222  10     6 2018       1    112 136557  136557   0.252120
## 223  11     6 2018       1    112 136557  136557   0.294469
## 224  12     6 2018       1    112 136557  136557   0.294857
## 225  13     6 2018       1    112 136557  136557   0.286354
## 226  14     6 2018       1    112 136557  136557   0.278610
## 227  15     6 2018       1    112 136557  136557   0.271423
## 228  16     6 2018       1    112 136557  136557   0.264658
## 229  17     6 2018       1    112 136557  136557   0.259786
## 230  18     6 2018       1    112 136557  136557   0.274081
## 231  19     6 2018       1    112 136557  136557   0.293087
## 232  20     6 2018       1    112 136557  136557   0.284782
## 233  21     6 2018       1    112 136557  136557   0.277185
## 234  22     6 2018       1    112 136557  136557   0.323404
## 235  23     6 2018       1    112 136557  136557   0.363989
## 236  24     6 2018       1    112 136557  136557   0.350164
## 237  25     6 2018       1    112 136557  136557   0.371141
## 238  26     6 2018       1    112 136557  136557   0.364314
## 239  27     6 2018       1    112 136557  136557   0.354695
## 240  28     6 2018       1    112 136557  136557   0.373183
## 241  29     6 2018       1    112 136557  136557   0.344540
## 242  30     6 2018       1    112 136557  136557   0.345826
## 243   1     7 2018       1    112 136557  136557   0.335548
## 244   2     7 2018       1    112 136557  136557   0.364322
## 245   3     7 2018       1    112 136557  136557   0.340457
## 246   4     7 2018       1    112 136557  136557   0.325046
## 247   5     7 2018       1    112 136557  136557   0.355348
## 248   6     7 2018       1    112 136557  136557   0.341653
## 249   7     7 2018       1    112 136557  136557   0.259786
## 250   8     7 2018       1    112 136557  136557   0.254919
## 251   9     7 2018       1    112 136557  136557   0.250067
## 252  10     7 2018       1    112 136557  136557   0.245893
## 253  11     7 2018       1    112 136557  136557   0.242185
## 254  12     7 2018       1    112 136557  136557   0.374708
## 255  13     7 2018       1    112 136557  136557   0.259786
## 256  14     7 2018       1    112 136557  136557   0.261692
## 257  15     7 2018       1    112 136557  136557   0.272325
## 258  16     7 2018       1    112 136557  136557   0.371223
## 259  17     7 2018       1    112 136557  136557   0.352781
## 260  18     7 2018       1    112 136557  136557   0.333709
## 261  19     7 2018       1    112 136557  136557   0.321117
## 262  20     7 2018       1    112 136557  136557   0.311216
## 263  21     7 2018       1    112 136557  136557   0.340160
## 264  22     7 2018       1    112 136557  136557   0.336891
## 265  23     7 2018       1    112 136557  136557   0.335943
## 266  24     7 2018       1    112 136557  136557   0.354306
## 267  25     7 2018       1    112 136557  136557   0.338500
## 268  26     7 2018       1    112 136557  136557   0.323157
## 269  27     7 2018       1    112 136557  136557   0.311731
## 270  28     7 2018       1    112 136557  136557   0.302181
## 271  29     7 2018       1    112 136557  136557   0.293356
## 272  30     7 2018       1    112 136557  136557   0.301262
## 273  31     7 2018       1    112 136557  136557   0.259786
## 274   1     8 2018       1    112 136557  136557   0.259786
## 275   2     8 2018       1    112 136557  136557   0.372516
## 276   3     8 2018       1    112 136557  136557   0.259786
## 277   4     8 2018       1    112 136557  136557   0.260120
## 278   5     8 2018       1    112 136557  136557   0.327364
## 279   6     8 2018       1    112 136557  136557   0.358721
## 280   7     8 2018       1    112 136557  136557   0.337169
## 281   8     8 2018       1    112 136557  136557   0.366711
## 282   9     8 2018       1    112 136557  136557   0.259786
## 283  10     8 2018       1    112 136557  136557   0.280379
## 284  11     8 2018       1    112 136557  136557   0.280539
## 285  12     8 2018       1    112 136557  136557   0.274652
## 286  13     8 2018       1    112 136557  136557   0.268145
## 287  14     8 2018       1    112 136557  136557   0.263165
## 288  15     8 2018       1    112 136557  136557   0.259682
## 289  16     8 2018       1    112 136557  136557   0.256084
## 290  17     8 2018       1    112 136557  136557   0.253042
## 291  18     8 2018       1    112 136557  136557   0.318666
## 292  19     8 2018       1    112 136557  136557   0.318271
## 293  20     8 2018       1    112 136557  136557   0.346781
## 294  21     8 2018       1    112 136557  136557   0.346095
## 295  22     8 2018       1    112 136557  136557   0.329234
## 296  23     8 2018       1    112 136557  136557   0.315587
## 297  24     8 2018       1    112 136557  136557   0.305137
## 298  25     8 2018       1    112 136557  136557   0.295747
## 299  26     8 2018       1    112 136557  136557   0.287257
## 300  27     8 2018       1    112 136557  136557   0.280227
## 301  28     8 2018       1    112 136557  136557   0.274762
## 302  29     8 2018       1    112 136557  136557   0.292088
## 303  30     8 2018       1    112 136557  136557   0.289694
## 304  31     8 2018       1    112 136557  136557   0.304082
## 305   1     9 2018       1    112 136557  136557   0.300292
## 306   2     9 2018       1    112 136557  136557   0.292354
## 307   3     9 2018       1    112 136557  136557   0.284880
## 308   4     9 2018       1    112 136557  136557   0.279241
## 309   5     9 2018       1    112 136557  136557   0.274989
## 310   6     9 2018       1    112 136557  136557   0.280057
## 311   7     9 2018       1    112 136557  136557   0.274142
## 312   8     9 2018       1    112 136557  136557   0.268826
## 313   9     9 2018       1    112 136557  136557   0.368220
## 314  10     9 2018       1    112 136557  136557   0.370605
## 315  11     9 2018       1    112 136557  136557   0.373310
## 316  12     9 2018       1    112 136557  136557   0.349379
## 317  13     9 2018       1    112 136557  136557   0.336606
## 318  14     9 2018       1    112 136557  136557   0.329136
## 319  15     9 2018       1    112 136557  136557   0.317266
## 320  16     9 2018       1    112 136557  136557   0.371743
## 321  17     9 2018       1    112 136557  136557   0.349885
## 322  18     9 2018       1    112 136557  136557   0.332221
## 323  19     9 2018       1    112 136557  136557   0.319393
## 324  20     9 2018       1    112 136557  136557   0.309483
## 325  21     9 2018       1    112 136557  136557   0.300985
## 326  22     9 2018       1    112 136557  136557   0.292778
## 327  23     9 2018       1    112 136557  136557   0.286049
## 328  24     9 2018       1    112 136557  136557   0.326577
## 329  25     9 2018       1    112 136557  136557   0.373419
## 330  26     9 2018       1    112 136557  136557   0.374196
## 331  27     9 2018       1    112 136557  136557   0.259786
## 332  28     9 2018       1    112 136557  136557   0.266818
## 333  29     9 2018       1    112 136557  136557   0.287920
## 334  30     9 2018       1    112 136557  136557   0.287547
## 335   1    10 2018       1    112 136557  136557   0.288810
## 336   2    10 2018       1    112 136557  136557   0.283213
## 337   3    10 2018       1    112 136557  136557   0.278717
## 338   4    10 2018       1    112 136557  136557   0.273830
## 339   5    10 2018       1    112 136557  136557   0.269238
## 340   6    10 2018       1    112 136557  136557   0.265319
## 341   7    10 2018       1    112 136557  136557   0.227218
## 342   8    10 2018       1    112 136557  136557   0.228294
## 343   9    10 2018       1    112 136557  136557   0.250790
## 344  10    10 2018       1    112 136557  136557   0.259786
## 345  11    10 2018       1    112 136557  136557   0.331531
## 346  12    10 2018       1    112 136557  136557   0.244275
## 347  13    10 2018       1    112 136557  136557   0.216443
## 348  14    10 2018       1    112 136557  136557   0.221152
## 349  15    10 2018       1    112 136557  136557   0.201685
## 350  16    10 2018       1    112 136557  136557   0.338156
## 351  17    10 2018       1    112 136557  136557   0.329477
## 352  18    10 2018       1    112 136557  136557   0.320281
## 353  19    10 2018       1    112 136557  136557   0.313025
## 354  20    10 2018       1    112 136557  136557   0.337504
## 355  21    10 2018       1    112 136557  136557   0.326283
## 356  22    10 2018       1    112 136557  136557   0.317794
## 357  23    10 2018       1    112 136557  136557   0.310991
## 358  24    10 2018       1    112 136557  136557   0.305331
## 359  25    10 2018       1    112 136557  136557   0.333050
## 360  26    10 2018       1    112 136557  136557   0.259786
## 361  27    10 2018       1    112 136557  136557   0.259786
## 362  28    10 2018       1    112 136557  136557   0.259786
## 363  29    10 2018       1    112 136557  136557   0.259786
## 364  30    10 2018       1    112 136557  136557   0.259786
## 365  31    10 2018       1    112 136557  136557   0.259786
##     rootzone.potential_sat rootzone.field_capacity rz_storage       date
## 1                 0.122944                0.031939   0.028002 2017-11-01
## 2                 0.122944                0.031939   0.025326 2017-11-02
## 3                 0.122944                0.031939   0.023471 2017-11-03
## 4                 0.122944                0.031939   0.022072 2017-11-04
## 5                 0.122944                0.031939   0.020962 2017-11-05
## 6                 0.122944                0.031939   0.021146 2017-11-06
## 7                 0.122944                0.031939   0.036672 2017-11-07
## 8                 0.122944                0.031939   0.036554 2017-11-08
## 9                 0.122944                0.031939   0.037549 2017-11-09
## 10                0.122944                0.031939   0.029611 2017-11-10
## 11                0.122944                0.031939   0.026339 2017-11-11
## 12                0.122944                0.031939   0.032363 2017-11-12
## 13                0.122944                0.031939   0.032393 2017-11-13
## 14                0.122944                0.031939   0.027802 2017-11-14
## 15                0.122944                0.031939   0.025198 2017-11-15
## 16                0.122944                0.031939   0.023379 2017-11-16
## 17                0.122944                0.031939   0.021999 2017-11-17
## 18                0.122944                0.031939   0.034284 2017-11-18
## 19                0.122944                0.031939   0.034204 2017-11-19
## 20                0.122944                0.031939   0.028609 2017-11-20
## 21                0.122944                0.031939   0.028793 2017-11-21
## 22                0.122944                0.031939   0.025844 2017-11-22
## 23                0.122944                0.031939   0.023850 2017-11-23
## 24                0.122944                0.031939   0.022365 2017-11-24
## 25                0.122944                0.031939   0.021195 2017-11-25
## 26                0.122944                0.031939   0.020239 2017-11-26
## 27                0.122944                0.031939   0.019437 2017-11-27
## 28                0.122944                0.031939   0.018751 2017-11-28
## 29                0.122944                0.031939   0.018155 2017-11-29
## 30                0.122944                0.031939   0.020314 2017-11-30
## 31                0.122944                0.031939   0.019500 2017-12-01
## 32                0.122944                0.031939   0.018804 2017-12-02
## 33                0.122944                0.031939   0.018200 2017-12-03
## 34                0.122944                0.031939   0.017669 2017-12-04
## 35                0.122944                0.031939   0.035619 2017-12-05
## 36                0.122944                0.031939   0.029162 2017-12-06
## 37                0.122944                0.031939   0.026088 2017-12-07
## 38                0.122944                0.031939   0.024031 2017-12-08
## 39                0.122944                0.031939   0.022506 2017-12-09
## 40                0.122944                0.031939   0.021308 2017-12-10
## 41                0.122944                0.031939   0.020331 2017-12-11
## 42                0.122944                0.031939   0.026788 2017-12-12
## 43                0.122944                0.031939   0.024526 2017-12-13
## 44                0.122944                0.031939   0.022884 2017-12-14
## 45                0.122944                0.031939   0.024380 2017-12-15
## 46                0.122944                0.031939   0.035853 2017-12-16
## 47                0.122944                0.031939   0.037011 2017-12-17
## 48                0.122944                0.031939   0.037034 2017-12-18
## 49                0.122944                0.031939   0.029608 2017-12-19
## 50                0.122944                0.031939   0.045217 2017-12-20
## 51                0.122944                0.031939   0.029313 2017-12-21
## 52                0.122944                0.031939   0.033908 2017-12-22
## 53                0.122944                0.031939   0.046086 2017-12-23
## 54                0.122944                0.031939   0.028962 2017-12-24
## 55                0.122944                0.031939   0.025977 2017-12-25
## 56                0.122944                0.031939   0.023958 2017-12-26
## 57                0.122944                0.031939   0.022453 2017-12-27
## 58                0.122944                0.031939   0.021266 2017-12-28
## 59                0.122944                0.031939   0.020296 2017-12-29
## 60                0.122944                0.031939   0.019481 2017-12-30
## 61                0.122944                0.031939   0.018783 2017-12-31
## 62                0.122944                0.031939   0.018175 2018-01-01
## 63                0.122944                0.031939   0.017640 2018-01-02
## 64                0.122944                0.031939   0.017164 2018-01-03
## 65                0.122944                0.031939   0.016737 2018-01-04
## 66                0.122944                0.031939   0.016350 2018-01-05
## 67                0.122944                0.031939   0.015999 2018-01-06
## 68                0.122944                0.031939   0.015677 2018-01-07
## 69                0.122944                0.031939   0.016651 2018-01-08
## 70                0.122944                0.031939   0.016271 2018-01-09
## 71                0.122944                0.031939   0.018836 2018-01-10
## 72                0.122944                0.031939   0.031939 2018-01-11
## 73                0.122944                0.031939   0.040029 2018-01-12
## 74                0.122944                0.031939   0.030150 2018-01-13
## 75                0.122944                0.031939   0.026719 2018-01-14
## 76                0.122944                0.031939   0.024491 2018-01-15
## 77                0.122944                0.031939   0.025043 2018-01-16
## 78                0.122944                0.031939   0.023279 2018-01-17
## 79                0.122944                0.031939   0.021926 2018-01-18
## 80                0.122944                0.031939   0.020840 2018-01-19
## 81                0.122944                0.031939   0.019940 2018-01-20
## 82                0.122944                0.031939   0.019177 2018-01-21
## 83                0.122944                0.031939   0.040738 2018-01-22
## 84                0.122944                0.031939   0.039890 2018-01-23
## 85                0.122944                0.031939   0.030147 2018-01-24
## 86                0.122944                0.031939   0.026720 2018-01-25
## 87                0.122944                0.031939   0.024493 2018-01-26
## 88                0.122944                0.031939   0.035907 2018-01-27
## 89                0.122944                0.031939   0.043338 2018-01-28
## 90                0.122944                0.031939   0.029959 2018-01-29
## 91                0.122944                0.031939   0.026608 2018-01-30
## 92                0.122944                0.031939   0.024416 2018-01-31
## 93                0.122944                0.031939   0.026970 2018-02-01
## 94                0.122944                0.031939   0.024669 2018-02-02
## 95                0.122944                0.031939   0.023000 2018-02-03
## 96                0.122944                0.031939   0.046081 2018-02-04
## 97                0.122944                0.031939   0.029084 2018-02-05
## 98                0.122944                0.031939   0.030650 2018-02-06
## 99                0.122944                0.031939   0.031939 2018-02-07
## 100               0.122944                0.031939   0.027735 2018-02-08
## 101               0.122944                0.031939   0.025192 2018-02-09
## 102               0.122944                0.031939   0.031939 2018-02-10
## 103               0.122944                0.031939   0.031939 2018-02-11
## 104               0.122944                0.031939   0.040480 2018-02-12
## 105               0.122944                0.031939   0.041503 2018-02-13
## 106               0.122944                0.031939   0.030121 2018-02-14
## 107               0.122944                0.031939   0.036369 2018-02-15
## 108               0.122944                0.031939   0.029427 2018-02-16
## 109               0.122944                0.031939   0.039331 2018-02-17
## 110               0.122944                0.031939   0.040340 2018-02-18
## 111               0.122944                0.031939   0.040432 2018-02-19
## 112               0.122944                0.031939   0.041152 2018-02-20
## 113               0.122944                0.031939   0.031939 2018-02-21
## 114               0.122944                0.031939   0.027686 2018-02-22
## 115               0.122944                0.031939   0.025134 2018-02-23
## 116               0.122944                0.031939   0.025318 2018-02-24
## 117               0.122944                0.031939   0.033305 2018-02-25
## 118               0.122944                0.031939   0.036122 2018-02-26
## 119               0.122944                0.031939   0.029305 2018-02-27
## 120               0.122944                0.031939   0.045660 2018-02-28
## 121               0.122944                0.031939   0.031939 2018-03-01
## 122               0.122944                0.031939   0.027671 2018-03-02
## 123               0.122944                0.031939   0.025118 2018-03-03
## 124               0.122944                0.031939   0.023322 2018-03-04
## 125               0.122944                0.031939   0.021955 2018-03-05
## 126               0.122944                0.031939   0.036676 2018-03-06
## 127               0.122944                0.031939   0.037106 2018-03-07
## 128               0.122944                0.031939   0.029550 2018-03-08
## 129               0.122944                0.031939   0.026313 2018-03-09
## 130               0.122944                0.031939   0.024184 2018-03-10
## 131               0.122944                0.031939   0.026541 2018-03-11
## 132               0.122944                0.031939   0.035424 2018-03-12
## 133               0.122944                0.031939   0.034770 2018-03-13
## 134               0.122944                0.031939   0.034248 2018-03-14
## 135               0.122944                0.031939   0.033521 2018-03-15
## 136               0.122944                0.031939   0.032887 2018-03-16
## 137               0.122944                0.031939   0.038990 2018-03-17
## 138               0.122944                0.031939   0.037732 2018-03-18
## 139               0.122944                0.031939   0.045968 2018-03-19
## 140               0.122944                0.031939   0.046053 2018-03-20
## 141               0.122944                0.031939   0.043224 2018-03-21
## 142               0.122944                0.031939   0.041035 2018-03-22
## 143               0.122944                0.031939   0.039421 2018-03-23
## 144               0.122944                0.031939   0.045879 2018-03-24
## 145               0.122944                0.031939   0.045654 2018-03-25
## 146               0.122944                0.031939   0.042535 2018-03-26
## 147               0.122944                0.031939   0.040579 2018-03-27
## 148               0.122944                0.031939   0.039033 2018-03-28
## 149               0.122944                0.031939   0.042130 2018-03-29
## 150               0.122944                0.031939   0.040203 2018-03-30
## 151               0.122944                0.031939   0.038720 2018-03-31
## 152               0.122944                0.031939   0.037467 2018-04-01
## 153               0.122944                0.031939   0.036411 2018-04-02
## 154               0.122944                0.031939   0.035572 2018-04-03
## 155               0.122944                0.031939   0.039358 2018-04-04
## 156               0.122944                0.031939   0.037977 2018-04-05
## 157               0.122944                0.031939   0.041887 2018-04-06
## 158               0.122944                0.031939   0.044279 2018-04-07
## 159               0.122944                0.031939   0.041661 2018-04-08
## 160               0.122944                0.031939   0.041982 2018-04-09
## 161               0.122944                0.031939   0.040116 2018-04-10
## 162               0.122944                0.031939   0.038650 2018-04-11
## 163               0.122944                0.031939   0.037400 2018-04-12
## 164               0.122944                0.031939   0.036403 2018-04-13
## 165               0.122944                0.031939   0.035618 2018-04-14
## 166               0.122944                0.031939   0.031939 2018-04-15
## 167               0.122944                0.031939   0.031839 2018-04-16
## 168               0.122944                0.031939   0.031223 2018-04-17
## 169               0.122944                0.031939   0.030591 2018-04-18
## 170               0.122944                0.031939   0.030154 2018-04-19
## 171               0.122944                0.031939   0.029577 2018-04-20
## 172               0.122944                0.031939   0.029197 2018-04-21
## 173               0.122944                0.031939   0.033220 2018-04-22
## 174               0.122944                0.031939   0.031939 2018-04-23
## 175               0.122944                0.031939   0.045902 2018-04-24
## 176               0.122944                0.031939   0.042634 2018-04-25
## 177               0.122944                0.031939   0.045389 2018-04-26
## 178               0.122944                0.031939   0.042216 2018-04-27
## 179               0.122944                0.031939   0.040174 2018-04-28
## 180               0.122944                0.031939   0.038656 2018-04-29
## 181               0.122944                0.031939   0.037298 2018-04-30
## 182               0.122944                0.031939   0.036102 2018-05-01
## 183               0.122944                0.031939   0.035119 2018-05-02
## 184               0.122944                0.031939   0.034186 2018-05-03
## 185               0.122944                0.031939   0.033280 2018-05-04
## 186               0.122944                0.031939   0.032714 2018-05-05
## 187               0.122944                0.031939   0.034423 2018-05-06
## 188               0.122944                0.031939   0.045315 2018-05-07
## 189               0.122944                0.031939   0.044902 2018-05-08
## 190               0.122944                0.031939   0.042459 2018-05-09
## 191               0.122944                0.031939   0.041095 2018-05-10
## 192               0.122944                0.031939   0.039257 2018-05-11
## 193               0.122944                0.031939   0.037775 2018-05-12
## 194               0.122944                0.031939   0.036499 2018-05-13
## 195               0.122944                0.031939   0.035384 2018-05-14
## 196               0.122944                0.031939   0.042401 2018-05-15
## 197               0.122944                0.031939   0.031939 2018-05-16
## 198               0.122944                0.031939   0.031939 2018-05-17
## 199               0.122944                0.031939   0.037102 2018-05-18
## 200               0.122944                0.031939   0.045204 2018-05-19
## 201               0.122944                0.031939   0.042743 2018-05-20
## 202               0.122944                0.031939   0.040437 2018-05-21
## 203               0.122944                0.031939   0.036589 2018-05-22
## 204               0.122944                0.031939   0.036231 2018-05-23
## 205               0.122944                0.031939   0.035240 2018-05-24
## 206               0.122944                0.031939   0.039536 2018-05-25
## 207               0.122944                0.031939   0.031939 2018-05-26
## 208               0.122944                0.031939   0.039914 2018-05-27
## 209               0.122944                0.031939   0.031939 2018-05-28
## 210               0.122944                0.031939   0.031939 2018-05-29
## 211               0.122944                0.031939   0.031939 2018-05-30
## 212               0.122944                0.031939   0.033328 2018-05-31
## 213               0.122944                0.031939   0.035882 2018-06-01
## 214               0.122944                0.031939   0.034867 2018-06-02
## 215               0.122944                0.031939   0.033936 2018-06-03
## 216               0.122944                0.031939   0.033067 2018-06-04
## 217               0.122944                0.031939   0.032246 2018-06-05
## 218               0.122944                0.031939   0.031709 2018-06-06
## 219               0.122944                0.031939   0.031245 2018-06-07
## 220               0.122944                0.031939   0.030775 2018-06-08
## 221               0.122944                0.031939   0.030299 2018-06-09
## 222               0.122944                0.031939   0.030997 2018-06-10
## 223               0.122944                0.031939   0.036203 2018-06-11
## 224               0.122944                0.031939   0.036251 2018-06-12
## 225               0.122944                0.031939   0.035205 2018-06-13
## 226               0.122944                0.031939   0.034253 2018-06-14
## 227               0.122944                0.031939   0.033370 2018-06-15
## 228               0.122944                0.031939   0.032538 2018-06-16
## 229               0.122944                0.031939   0.031939 2018-06-17
## 230               0.122944                0.031939   0.033696 2018-06-18
## 231               0.122944                0.031939   0.036033 2018-06-19
## 232               0.122944                0.031939   0.035012 2018-06-20
## 233               0.122944                0.031939   0.034078 2018-06-21
## 234               0.122944                0.031939   0.039760 2018-06-22
## 235               0.122944                0.031939   0.044750 2018-06-23
## 236               0.122944                0.031939   0.043050 2018-06-24
## 237               0.122944                0.031939   0.045629 2018-06-25
## 238               0.122944                0.031939   0.044790 2018-06-26
## 239               0.122944                0.031939   0.043607 2018-06-27
## 240               0.122944                0.031939   0.045880 2018-06-28
## 241               0.122944                0.031939   0.042359 2018-06-29
## 242               0.122944                0.031939   0.042517 2018-06-30
## 243               0.122944                0.031939   0.041253 2018-07-01
## 244               0.122944                0.031939   0.044791 2018-07-02
## 245               0.122944                0.031939   0.041857 2018-07-03
## 246               0.122944                0.031939   0.039962 2018-07-04
## 247               0.122944                0.031939   0.043688 2018-07-05
## 248               0.122944                0.031939   0.042004 2018-07-06
## 249               0.122944                0.031939   0.031939 2018-07-07
## 250               0.122944                0.031939   0.031341 2018-07-08
## 251               0.122944                0.031939   0.030744 2018-07-09
## 252               0.122944                0.031939   0.030231 2018-07-10
## 253               0.122944                0.031939   0.029775 2018-07-11
## 254               0.122944                0.031939   0.046068 2018-07-12
## 255               0.122944                0.031939   0.031939 2018-07-13
## 256               0.122944                0.031939   0.032173 2018-07-14
## 257               0.122944                0.031939   0.033481 2018-07-15
## 258               0.122944                0.031939   0.045640 2018-07-16
## 259               0.122944                0.031939   0.043372 2018-07-17
## 260               0.122944                0.031939   0.041027 2018-07-18
## 261               0.122944                0.031939   0.039479 2018-07-19
## 262               0.122944                0.031939   0.038262 2018-07-20
## 263               0.122944                0.031939   0.041821 2018-07-21
## 264               0.122944                0.031939   0.041419 2018-07-22
## 265               0.122944                0.031939   0.041302 2018-07-23
## 266               0.122944                0.031939   0.043560 2018-07-24
## 267               0.122944                0.031939   0.041616 2018-07-25
## 268               0.122944                0.031939   0.039730 2018-07-26
## 269               0.122944                0.031939   0.038325 2018-07-27
## 270               0.122944                0.031939   0.037151 2018-07-28
## 271               0.122944                0.031939   0.036066 2018-07-29
## 272               0.122944                0.031939   0.037038 2018-07-30
## 273               0.122944                0.031939   0.031939 2018-07-31
## 274               0.122944                0.031939   0.031939 2018-08-01
## 275               0.122944                0.031939   0.045798 2018-08-02
## 276               0.122944                0.031939   0.031939 2018-08-03
## 277               0.122944                0.031939   0.031980 2018-08-04
## 278               0.122944                0.031939   0.040247 2018-08-05
## 279               0.122944                0.031939   0.044102 2018-08-06
## 280               0.122944                0.031939   0.041453 2018-08-07
## 281               0.122944                0.031939   0.045085 2018-08-08
## 282               0.122944                0.031939   0.031939 2018-08-09
## 283               0.122944                0.031939   0.034471 2018-08-10
## 284               0.122944                0.031939   0.034490 2018-08-11
## 285               0.122944                0.031939   0.033767 2018-08-12
## 286               0.122944                0.031939   0.032967 2018-08-13
## 287               0.122944                0.031939   0.032354 2018-08-14
## 288               0.122944                0.031939   0.031926 2018-08-15
## 289               0.122944                0.031939   0.031484 2018-08-16
## 290               0.122944                0.031939   0.031110 2018-08-17
## 291               0.122944                0.031939   0.039178 2018-08-18
## 292               0.122944                0.031939   0.039129 2018-08-19
## 293               0.122944                0.031939   0.042635 2018-08-20
## 294               0.122944                0.031939   0.042550 2018-08-21
## 295               0.122944                0.031939   0.040477 2018-08-22
## 296               0.122944                0.031939   0.038799 2018-08-23
## 297               0.122944                0.031939   0.037515 2018-08-24
## 298               0.122944                0.031939   0.036360 2018-08-25
## 299               0.122944                0.031939   0.035316 2018-08-26
## 300               0.122944                0.031939   0.034452 2018-08-27
## 301               0.122944                0.031939   0.033780 2018-08-28
## 302               0.122944                0.031939   0.035910 2018-08-29
## 303               0.122944                0.031939   0.035616 2018-08-30
## 304               0.122944                0.031939   0.037385 2018-08-31
## 305               0.122944                0.031939   0.036919 2018-09-01
## 306               0.122944                0.031939   0.035943 2018-09-02
## 307               0.122944                0.031939   0.035024 2018-09-03
## 308               0.122944                0.031939   0.034331 2018-09-04
## 309               0.122944                0.031939   0.033808 2018-09-05
## 310               0.122944                0.031939   0.034431 2018-09-06
## 311               0.122944                0.031939   0.033704 2018-09-07
## 312               0.122944                0.031939   0.033050 2018-09-08
## 313               0.122944                0.031939   0.045270 2018-09-09
## 314               0.122944                0.031939   0.045563 2018-09-10
## 315               0.122944                0.031939   0.045896 2018-09-11
## 316               0.122944                0.031939   0.042954 2018-09-12
## 317               0.122944                0.031939   0.041384 2018-09-13
## 318               0.122944                0.031939   0.040465 2018-09-14
## 319               0.122944                0.031939   0.039006 2018-09-15
## 320               0.122944                0.031939   0.045703 2018-09-16
## 321               0.122944                0.031939   0.043016 2018-09-17
## 322               0.122944                0.031939   0.040844 2018-09-18
## 323               0.122944                0.031939   0.039267 2018-09-19
## 324               0.122944                0.031939   0.038049 2018-09-20
## 325               0.122944                0.031939   0.037004 2018-09-21
## 326               0.122944                0.031939   0.035995 2018-09-22
## 327               0.122944                0.031939   0.035168 2018-09-23
## 328               0.122944                0.031939   0.040151 2018-09-24
## 329               0.122944                0.031939   0.045909 2018-09-25
## 330               0.122944                0.031939   0.046005 2018-09-26
## 331               0.122944                0.031939   0.031939 2018-09-27
## 332               0.122944                0.031939   0.032804 2018-09-28
## 333               0.122944                0.031939   0.035398 2018-09-29
## 334               0.122944                0.031939   0.035352 2018-09-30
## 335               0.122944                0.031939   0.035507 2018-10-01
## 336               0.122944                0.031939   0.034819 2018-10-02
## 337               0.122944                0.031939   0.034267 2018-10-03
## 338               0.122944                0.031939   0.033666 2018-10-04
## 339               0.122944                0.031939   0.033101 2018-10-05
## 340               0.122944                0.031939   0.032619 2018-10-06
## 341               0.122944                0.031939   0.027935 2018-10-07
## 342               0.122944                0.031939   0.028067 2018-10-08
## 343               0.122944                0.031939   0.030833 2018-10-09
## 344               0.122944                0.031939   0.031939 2018-10-10
## 345               0.122944                0.031939   0.040760 2018-10-11
## 346               0.122944                0.031939   0.030032 2018-10-12
## 347               0.122944                0.031939   0.026610 2018-10-13
## 348               0.122944                0.031939   0.027189 2018-10-14
## 349               0.122944                0.031939   0.024796 2018-10-15
## 350               0.122944                0.031939   0.041574 2018-10-16
## 351               0.122944                0.031939   0.040507 2018-10-17
## 352               0.122944                0.031939   0.039376 2018-10-18
## 353               0.122944                0.031939   0.038484 2018-10-19
## 354               0.122944                0.031939   0.041494 2018-10-20
## 355               0.122944                0.031939   0.040114 2018-10-21
## 356               0.122944                0.031939   0.039071 2018-10-22
## 357               0.122944                0.031939   0.038234 2018-10-23
## 358               0.122944                0.031939   0.037539 2018-10-24
## 359               0.122944                0.031939   0.040946 2018-10-25
## 360               0.122944                0.031939   0.031939 2018-10-26
## 361               0.122944                0.031939   0.031939 2018-10-27
## 362               0.122944                0.031939   0.031939 2018-10-28
## 363               0.122944                0.031939   0.031939 2018-10-29
## 364               0.122944                0.031939   0.031939 2018-10-30
## 365               0.122944                0.031939   0.031939 2018-10-31
##     rootzonevwc
## 1    0.02800259
## 2    0.02532573
## 3    0.02347087
## 4    0.02207189
## 5    0.02096183
## 6    0.02114563
## 7    0.03667174
## 8    0.03655432
## 9    0.03754931
## 10   0.02961094
## 11   0.02633903
## 12   0.03236316
## 13   0.03239353
## 14   0.02780182
## 15   0.02519823
## 16   0.02337891
## 17   0.02199935
## 18   0.03428416
## 19   0.03420376
## 20   0.02860907
## 21   0.02879299
## 22   0.02584369
## 23   0.02385003
## 24   0.02236474
## 25   0.02119505
## 26   0.02023929
## 27   0.01943745
## 28   0.01875142
## 29   0.01815514
## 30   0.02031453
## 31   0.01950027
## 32   0.01880441
## 33   0.01820014
## 34   0.01766877
## 35   0.03561909
## 36   0.02916207
## 37   0.02608835
## 38   0.02403100
## 39   0.02250588
## 40   0.02130804
## 41   0.02033088
## 42   0.02678802
## 43   0.02452659
## 44   0.02288430
## 45   0.02437955
## 46   0.03585305
## 47   0.03701082
## 48   0.03703454
## 49   0.02960787
## 50   0.04521671
## 51   0.02931329
## 52   0.03390796
## 53   0.04608580
## 54   0.02896180
## 55   0.02597733
## 56   0.02395847
## 57   0.02245314
## 58   0.02126648
## 59   0.02029584
## 60   0.01948085
## 61   0.01878277
## 62   0.01817555
## 63   0.01764050
## 64   0.01716446
## 65   0.01673698
## 66   0.01635045
## 67   0.01599870
## 68   0.01567671
## 69   0.01665080
## 70   0.01627152
## 71   0.01883600
## 72   0.03193913
## 73   0.04002909
## 74   0.03015054
## 75   0.02671917
## 76   0.02449143
## 77   0.02504357
## 78   0.02327957
## 79   0.02192645
## 80   0.02083999
## 81   0.01993980
## 82   0.01917656
## 83   0.04073786
## 84   0.03989016
## 85   0.03014759
## 86   0.02671967
## 87   0.02449327
## 88   0.03590764
## 89   0.04333837
## 90   0.02995924
## 91   0.02660852
## 92   0.02441594
## 93   0.02697035
## 94   0.02466908
## 95   0.02300012
## 96   0.04608101
## 97   0.02908363
## 98   0.03065043
## 99   0.03193913
## 100  0.02773543
## 101  0.02519246
## 102  0.03193913
## 103  0.03193913
## 104  0.04048042
## 105  0.04150344
## 106  0.03012079
## 107  0.03636942
## 108  0.02942763
## 109  0.03933138
## 110  0.04034014
## 111  0.04043259
## 112  0.04115243
## 113  0.03193913
## 114  0.02768588
## 115  0.02513430
## 116  0.02531810
## 117  0.03330528
## 118  0.03612181
## 119  0.02930542
## 120  0.04566017
## 121  0.03193913
## 122  0.02767113
## 123  0.02511844
## 124  0.02332199
## 125  0.02195472
## 126  0.03667665
## 127  0.03710610
## 128  0.02954996
## 129  0.02631297
## 130  0.02418419
## 131  0.02654115
## 132  0.03542459
## 133  0.03477053
## 134  0.03424814
## 135  0.03352080
## 136  0.03288752
## 137  0.03898997
## 138  0.03773201
## 139  0.04596864
## 140  0.04605347
## 141  0.04322391
## 142  0.04103502
## 143  0.03942076
## 144  0.04587963
## 145  0.04565452
## 146  0.04253506
## 147  0.04057963
## 148  0.03903361
## 149  0.04212996
## 150  0.04020269
## 151  0.03872023
## 152  0.03746743
## 153  0.03641110
## 154  0.03557249
## 155  0.03935831
## 156  0.03797691
## 157  0.04188764
## 158  0.04427927
## 159  0.04166166
## 160  0.04198255
## 161  0.04011601
## 162  0.03864966
## 163  0.03739993
## 164  0.03640310
## 165  0.03561811
## 166  0.03193913
## 167  0.03183905
## 168  0.03122298
## 169  0.03059093
## 170  0.03015423
## 171  0.02957750
## 172  0.02919686
## 173  0.03321996
## 174  0.03193913
## 175  0.04590237
## 176  0.04263378
## 177  0.04538945
## 178  0.04221614
## 179  0.04017380
## 180  0.03865618
## 181  0.03729789
## 182  0.03610177
## 183  0.03511871
## 184  0.03418605
## 185  0.03328057
## 186  0.03271405
## 187  0.03442309
## 188  0.04531544
## 189  0.04490235
## 190  0.04245945
## 191  0.04109502
## 192  0.03925676
## 193  0.03777479
## 194  0.03649888
## 195  0.03538439
## 196  0.04240105
## 197  0.03193913
## 198  0.03193913
## 199  0.03710241
## 200  0.04520380
## 201  0.04274320
## 202  0.04043751
## 203  0.03658887
## 204  0.03623160
## 205  0.03523968
## 206  0.03953633
## 207  0.03193913
## 208  0.03991402
## 209  0.03193913
## 210  0.03193913
## 211  0.03193913
## 212  0.03332791
## 213  0.03588219
## 214  0.03486729
## 215  0.03393611
## 216  0.03306739
## 217  0.03224612
## 218  0.03170959
## 219  0.03124499
## 220  0.03077485
## 221  0.03029918
## 222  0.03099664
## 223  0.03620320
## 224  0.03625090
## 225  0.03520551
## 226  0.03425343
## 227  0.03336983
## 228  0.03253811
## 229  0.03193913
## 230  0.03369661
## 231  0.03603329
## 232  0.03501224
## 233  0.03407823
## 234  0.03976058
## 235  0.04475026
## 236  0.04305056
## 237  0.04562956
## 238  0.04479022
## 239  0.04360762
## 240  0.04588061
## 241  0.04235913
## 242  0.04251723
## 243  0.04125361
## 244  0.04479120
## 245  0.04185715
## 246  0.03996246
## 247  0.04368790
## 248  0.04200419
## 249  0.03193913
## 250  0.03134076
## 251  0.03074424
## 252  0.03023107
## 253  0.02977519
## 254  0.04606810
## 255  0.03193913
## 256  0.03217346
## 257  0.03348072
## 258  0.04563964
## 259  0.04337231
## 260  0.04102752
## 261  0.03947941
## 262  0.03826214
## 263  0.04182063
## 264  0.04141873
## 265  0.04130218
## 266  0.04355980
## 267  0.04161654
## 268  0.03973021
## 269  0.03832546
## 270  0.03715134
## 271  0.03606636
## 272  0.03703836
## 273  0.03193913
## 274  0.03193913
## 275  0.04579861
## 276  0.03193913
## 277  0.03198019
## 278  0.04024744
## 279  0.04410259
## 280  0.04145291
## 281  0.04508492
## 282  0.03193913
## 283  0.03447092
## 284  0.03449059
## 285  0.03376682
## 286  0.03296682
## 287  0.03235456
## 288  0.03192634
## 289  0.03148399
## 290  0.03111000
## 291  0.03917807
## 292  0.03912951
## 293  0.04263464
## 294  0.04255030
## 295  0.04047734
## 296  0.03879953
## 297  0.03751476
## 298  0.03636032
## 299  0.03531652
## 300  0.03445223
## 301  0.03378034
## 302  0.03591047
## 303  0.03561614
## 304  0.03738506
## 305  0.03691910
## 306  0.03594317
## 307  0.03502429
## 308  0.03433101
## 309  0.03380825
## 310  0.03443133
## 311  0.03370411
## 312  0.03305054
## 313  0.04527044
## 314  0.04556366
## 315  0.04589622
## 316  0.04295405
## 317  0.04138369
## 318  0.04046530
## 319  0.03900595
## 320  0.04570357
## 321  0.04301626
## 322  0.04084458
## 323  0.03926745
## 324  0.03804908
## 325  0.03700430
## 326  0.03599530
## 327  0.03516801
## 328  0.04015068
## 329  0.04590963
## 330  0.04600515
## 331  0.03193913
## 332  0.03280367
## 333  0.03539804
## 334  0.03535218
## 335  0.03550746
## 336  0.03481934
## 337  0.03426658
## 338  0.03366576
## 339  0.03310120
## 340  0.03261938
## 341  0.02793509
## 342  0.02806738
## 343  0.03083313
## 344  0.03193913
## 345  0.04075975
## 346  0.03003215
## 347  0.02661037
## 348  0.02718931
## 349  0.02479596
## 350  0.04157425
## 351  0.04050722
## 352  0.03937663
## 353  0.03848455
## 354  0.04149409
## 355  0.04011454
## 356  0.03907087
## 357  0.03823448
## 358  0.03753861
## 359  0.04094650
## 360  0.03193913
## 361  0.03193913
## 362  0.03193913
## 363  0.03193913
## 364  0.03193913
## 365  0.03193913
{plot(cwws32valrss1_run1$date, cwws32valrss1_run1$rootzonevwc, type = 'l', ylim = c(0.12,0.26))
lines(valmergesm1$Date,valmergesm1$Site1, col = 'BLUE', lty = 3)}

{plot(cwws32valrss1_run3$date, cwws32valrss1_run3$rootzonevwc, type = 'l', ylim = c(0.12,0.26))
lines(valmergesm3$Date,valmergesm3$Site1, col = 'BLUE', lty = 3)}

plot((valmergesm3$rootzone.S*valmergesm3$rootzone.potential_sat), type = "l")

plot(valmergesm3$Date, (valmergesm3$rz_storage), type = "l")

plot(valmergesm3$Date, valmergesm3$Site1, type = "l")

{plot(cwws32valrss1_run3$date, cwws32valrss1_run3$rootzonevwc, type = 'l', ylim = c(0.0,0.26))
lines(valmergesm3$Date,valmergesm3$Site1, col = 'BLUE', lty = 3)}

{plot(cwws32valrss1_run2$date, cwws32valrss1_run2$rootzonevwc, type = 'l', ylim = c(0.0,0.26))
lines(valmergesm2$Date,valmergesm2$Site1, col = 'BLUE', lty = 3)}

paste0("valmergesm",i,"$rootzonevwc")
## [1] "valmergesm6$rootzonevwc"
{plot(cwws32valrss1_run3$date, (cwws32valrss1_run3$rootzone.S*cwws32valrss1_run3$rootzone.potential_sat), type = 'l', ylim = c(0.0,0.26))
lines(valmergesm3$Date,valmergesm3$Site1, col = 'BLUE', lty = 3)}

# {plot(cwws32valrss1_run44$date, (cwws32valrss1_run44$rootzone.S/cwws32valrss1_run44$root.depth), type = 'l', ylim = c(0.0,0.26))
# lines(valmergesm4$Date,valmergesm4$Site1, col = 'BLUE', lty = 3)}
# 
# {plot(cwws32valrss1_run43$date, (cwws32valrss1_run43$rootzone.S/cwws32valrss1_run43$rootzone.potential_sat), type = 'l', ylim = c(0.0,0.26))
# lines(valmergesm1$Date,valmergesm1$Site1, col = 'BLUE', lty = 3)}

RSS - prepare to run model n times for patch 2 - only for validation time series

RSS - run model in parallel

RSS - read n runs, create table and append to table

setwd(system.file("extdata/", package = "RHESSysIOinR"))
# Read in RHESSys Validation runs
for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch2_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valrss2_run",i),temp_dataset)
}

##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valrss2_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}

valmergesm1
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    110 141942  141942   0.239419                  0.435
## 2         1    110 141942  141942   0.240781                  0.435
## 3         1    110 141942  141942   0.233374                  0.435
## 4         1    110 141942  141942   0.291431                  0.435
## 5         1    110 141942  141942   0.275948                  0.435
## 6         1    110 141942  141942   0.286114                  0.435
## 7         1    110 141942  141942   0.325677                  0.435
## 8         1    110 141942  141942   0.302033                  0.435
## 9         1    110 141942  141942   0.284334                  0.435
## 10        1    110 141942  141942   0.270229                  0.435
## 11        1    110 141942  141942   0.258845                  0.435
## 12        1    110 141942  141942   0.249276                  0.435
## 13        1    110 141942  141942   0.240909                  0.435
## 14        1    110 141942  141942   0.233501                  0.435
## 15        1    110 141942  141942   0.226875                  0.435
## 16        1    110 141942  141942   0.220899                  0.435
## 17        1    110 141942  141942   0.215469                  0.435
## 18        1    110 141942  141942   0.210503                  0.435
## 19        1    110 141942  141942   0.205938                  0.435
## 20        1    110 141942  141942   0.201720                  0.435
## 21        1    110 141942  141942   0.197807                  0.435
## 22        1    110 141942  141942   0.194162                  0.435
## 23        1    110 141942  141942   0.196399                  0.435
## 24        1    110 141942  141942   0.192848                  0.435
## 25        1    110 141942  141942   0.198525                  0.435
## 26        1    110 141942  141942   0.346819                  0.435
## 27        1    110 141942  141942   0.397807                  0.435
## 28        1    110 141942  141942   0.344771                  0.435
## 29        1    110 141942  141942   0.315307                  0.435
## 30        1    110 141942  141942   0.294541                  0.435
## 31        1    110 141942  141942   0.295101                  0.435
## 32        1    110 141942  141942   0.278966                  0.435
## 33        1    110 141942  141942   0.265890                  0.435
## 34        1    110 141942  141942   0.255202                  0.435
## 35        1    110 141942  141942   0.246139                  0.435
## 36        1    110 141942  141942   0.247698                  0.435
## 37        1    110 141942  141942   0.296174                  0.435
## 38        1    110 141942  141942   0.295979                  0.435
## 39        1    110 141942  141942   0.279683                  0.435
## 40        1    110 141942  141942   0.266498                  0.435
## 41        1    110 141942  141942   0.255733                  0.435
## 42        1    110 141942  141942   0.282127                  0.435
## 43        1    110 141942  141942   0.329742                  0.435
## 44        1    110 141942  141942   0.305096                  0.435
## 45        1    110 141942  141942   0.286835                  0.435
## 46        1    110 141942  141942   0.272366                  0.435
## 47        1    110 141942  141942   0.277667                  0.435
## 48        1    110 141942  141942   0.264848                  0.435
## 49        1    110 141942  141942   0.254336                  0.435
## 50        1    110 141942  141942   0.318801                  0.435
## 51        1    110 141942  141942   0.297210                  0.435
## 52        1    110 141942  141942   0.299623                  0.435
## 53        1    110 141942  141942   0.380881                  0.435
## 54        1    110 141942  141942   0.336847                  0.435
## 55        1    110 141942  141942   0.310090                  0.435
## 56        1    110 141942  141942   0.429763                  0.435
## 57        1    110 141942  141942   0.259786                  0.435
## 58        1    110 141942  141942   0.280780                  0.435
## 59        1    110 141942  141942   0.285938                  0.435
## 60        1    110 141942  141942   0.271600                  0.435
## 61        1    110 141942  141942   0.285894                  0.435
## 62        1    110 141942  141942   0.271529                  0.435
## 63        1    110 141942  141942   0.294772                  0.435
## 64        1    110 141942  141942   0.298639                  0.435
## 65        1    110 141942  141942   0.300588                  0.435
## 66        1    110 141942  141942   0.304242                  0.435
## 67        1    110 141942  141942   0.368159                  0.435
## 68        1    110 141942  141942   0.329524                  0.435
## 69        1    110 141942  141942   0.304715                  0.435
## 70        1    110 141942  141942   0.303726                  0.435
## 71        1    110 141942  141942   0.320494                  0.435
## 72        1    110 141942  141942   0.325321                  0.435
## 73        1    110 141942  141942   0.301687                  0.435
## 74        1    110 141942  141942   0.355130                  0.435
## 75        1    110 141942  141942   0.402065                  0.435
## 76        1    110 141942  141942   0.346167                  0.435
## 77        1    110 141942  141942   0.315953                  0.435
## 78        1    110 141942  141942   0.294814                  0.435
## 79        1    110 141942  141942   0.278563                  0.435
## 80        1    110 141942  141942   0.311819                  0.435
## 81        1    110 141942  141942   0.312312                  0.435
## 82        1    110 141942  141942   0.292076                  0.435
## 83        1    110 141942  141942   0.276372                  0.435
## 84        1    110 141942  141942   0.263586                  0.435
## 85        1    110 141942  141942   0.268580                  0.435
## 86        1    110 141942  141942   0.288571                  0.435
## 87        1    110 141942  141942   0.273556                  0.435
## 88        1    110 141942  141942   0.261240                  0.435
## 89        1    110 141942  141942   0.251117                  0.435
## 90        1    110 141942  141942   0.242473                  0.435
## 91        1    110 141942  141942   0.257880                  0.435
## 92        1    110 141942  141942   0.248379                  0.435
## 93        1    110 141942  141942   0.278447                  0.435
## 94        1    110 141942  141942   0.293509                  0.435
## 95        1    110 141942  141942   0.277509                  0.435
## 96        1    110 141942  141942   0.264526                  0.435
## 97        1    110 141942  141942   0.264808                  0.435
## 98        1    110 141942  141942   0.290027                  0.435
## 99        1    110 141942  141942   0.300734                  0.435
## 100       1    110 141942  141942   0.283206                  0.435
## 101       1    110 141942  141942   0.269212                  0.435
## 102       1    110 141942  141942   0.257920                  0.435
## 103       1    110 141942  141942   0.302160                  0.435
## 104       1    110 141942  141942   0.284323                  0.435
## 105       1    110 141942  141942   0.270129                  0.435
## 106       1    110 141942  141942   0.258700                  0.435
## 107       1    110 141942  141942   0.249100                  0.435
## 108       1    110 141942  141942   0.240711                  0.435
## 109       1    110 141942  141942   0.251122                  0.435
## 110       1    110 141942  141942   0.242490                  0.435
## 111       1    110 141942  141942   0.254718                  0.435
## 112       1    110 141942  141942   0.289021                  0.435
## 113       1    110 141942  141942   0.287591                  0.435
## 114       1    110 141942  141942   0.291440                  0.435
## 115       1    110 141942  141942   0.289919                  0.435
## 116       1    110 141942  141942   0.288352                  0.435
## 117       1    110 141942  141942   0.286748                  0.435
## 118       1    110 141942  141942   0.285301                  0.435
## 119       1    110 141942  141942   0.284011                  0.435
## 120       1    110 141942  141942   0.390971                  0.435
## 121       1    110 141942  141942   0.378682                  0.435
## 122       1    110 141942  141942   0.368498                  0.435
## 123       1    110 141942  141942   0.360180                  0.435
## 124       1    110 141942  141942   0.353415                  0.435
## 125       1    110 141942  141942   0.347357                  0.435
## 126       1    110 141942  141942   0.342283                  0.435
## 127       1    110 141942  141942   0.347134                  0.435
## 128       1    110 141942  141942   0.409990                  0.435
## 129       1    110 141942  141942   0.422015                  0.435
## 130       1    110 141942  141942   0.399465                  0.435
## 131       1    110 141942  141942   0.408326                  0.435
## 132       1    110 141942  141942   0.390549                  0.435
## 133       1    110 141942  141942   0.377880                  0.435
## 134       1    110 141942  141942   0.368085                  0.435
## 135       1    110 141942  141942   0.359905                  0.435
## 136       1    110 141942  141942   0.352951                  0.435
## 137       1    110 141942  141942   0.347042                  0.435
## 138       1    110 141942  141942   0.341770                  0.435
## 139       1    110 141942  141942   0.336988                  0.435
## 140       1    110 141942  141942   0.333069                  0.435
## 141       1    110 141942  141942   0.334101                  0.435
## 142       1    110 141942  141942   0.361337                  0.435
## 143       1    110 141942  141942   0.362801                  0.435
## 144       1    110 141942  141942   0.356574                  0.435
## 145       1    110 141942  141942   0.351660                  0.435
## 146       1    110 141942  141942   0.345947                  0.435
## 147       1    110 141942  141942   0.340855                  0.435
## 148       1    110 141942  141942   0.336256                  0.435
## 149       1    110 141942  141942   0.332096                  0.435
## 150       1    110 141942  141942   0.347376                  0.435
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.113007   0.104147  0.10414727
## 2                  0.113007   0.104740  0.10473974
## 3                  0.113007   0.101518  0.10151769
## 4                  0.113007   0.126773  0.12677248
## 5                  0.113007   0.120038  0.12003738
## 6                  0.113007   0.124459  0.12445959
## 7                  0.113007   0.141669  0.14166950
## 8                  0.113007   0.131384  0.13138436
## 9                  0.113007   0.123685  0.12368529
## 10                 0.113007   0.117550  0.11754961
## 11                 0.113007   0.112597  0.11259757
## 12                 0.113007   0.108435  0.10843506
## 13                 0.113007   0.104795  0.10479542
## 14                 0.113007   0.101573  0.10157293
## 15                 0.113007   0.098691  0.09869062
## 16                 0.113007   0.096091  0.09609107
## 17                 0.113007   0.093729  0.09372901
## 18                 0.113007   0.091569  0.09156881
## 19                 0.113007   0.089583  0.08958303
## 20                 0.113007   0.087748  0.08774820
## 21                 0.113007   0.086046  0.08604605
## 22                 0.113007   0.084460  0.08446047
## 23                 0.113007   0.085433  0.08543356
## 24                 0.113007   0.083889  0.08388888
## 25                 0.113007   0.086358  0.08635838
## 26                 0.113007   0.150866  0.15086626
## 27                 0.113007   0.173046  0.17304605
## 28                 0.113007   0.149975  0.14997538
## 29                 0.113007   0.137158  0.13715854
## 30                 0.113007   0.128125  0.12812534
## 31                 0.113007   0.128369  0.12836893
## 32                 0.113007   0.121350  0.12135021
## 33                 0.113007   0.115662  0.11566215
## 34                 0.113007   0.111013  0.11101287
## 35                 0.113007   0.107071  0.10707047
## 36                 0.113007   0.107748  0.10774863
## 37                 0.113007   0.128836  0.12883569
## 38                 0.113007   0.128751  0.12875086
## 39                 0.113007   0.121662  0.12166211
## 40                 0.113007   0.115927  0.11592663
## 41                 0.113007   0.111244  0.11124385
## 42                 0.113007   0.122725  0.12272525
## 43                 0.113007   0.143438  0.14343777
## 44                 0.113007   0.132717  0.13271676
## 45                 0.113007   0.124773  0.12477323
## 46                 0.113007   0.118479  0.11847921
## 47                 0.113007   0.120785  0.12078514
## 48                 0.113007   0.115209  0.11520888
## 49                 0.113007   0.110636  0.11063616
## 50                 0.113007   0.138679  0.13867843
## 51                 0.113007   0.129287  0.12928635
## 52                 0.113007   0.130336  0.13033600
## 53                 0.113007   0.165683  0.16568324
## 54                 0.113007   0.146528  0.14652845
## 55                 0.113007   0.134889  0.13488915
## 56                 0.113007   0.186947  0.18694690
## 57                 0.113007   0.113007  0.11300691
## 58                 0.113007   0.122139  0.12213930
## 59                 0.113007   0.124383  0.12438303
## 60                 0.113007   0.118146  0.11814600
## 61                 0.113007   0.124364  0.12436389
## 62                 0.113007   0.118115  0.11811512
## 63                 0.113007   0.128226  0.12822582
## 64                 0.113007   0.129908  0.12990796
## 65                 0.113007   0.130756  0.13075578
## 66                 0.113007   0.132345  0.13234527
## 67                 0.113007   0.160149  0.16014917
## 68                 0.113007   0.143343  0.14334294
## 69                 0.113007   0.132551  0.13255103
## 70                 0.113007   0.132121  0.13212081
## 71                 0.113007   0.139415  0.13941489
## 72                 0.113007   0.141515  0.14151463
## 73                 0.113007   0.131234  0.13123384
## 74                 0.113007   0.154482  0.15448155
## 75                 0.113007   0.174898  0.17489827
## 76                 0.113007   0.150583  0.15058264
## 77                 0.113007   0.137440  0.13743955
## 78                 0.113007   0.128244  0.12824409
## 79                 0.113007   0.121175  0.12117490
## 80                 0.113007   0.135641  0.13564127
## 81                 0.113007   0.135856  0.13585572
## 82                 0.113007   0.127053  0.12705306
## 83                 0.113007   0.120222  0.12022182
## 84                 0.113007   0.114660  0.11465991
## 85                 0.113007   0.116832  0.11683230
## 86                 0.113007   0.125528  0.12552839
## 87                 0.113007   0.118997  0.11899686
## 88                 0.113007   0.113640  0.11363940
## 89                 0.113007   0.109236  0.10923589
## 90                 0.113007   0.105476  0.10547575
## 91                 0.113007   0.112178  0.11217780
## 92                 0.113007   0.108045  0.10804486
## 93                 0.113007   0.121124  0.12112444
## 94                 0.113007   0.127676  0.12767642
## 95                 0.113007   0.120717  0.12071642
## 96                 0.113007   0.115069  0.11506881
## 97                 0.113007   0.115191  0.11519148
## 98                 0.113007   0.126162  0.12616174
## 99                 0.113007   0.130819  0.13081929
## 100                0.113007   0.123195  0.12319461
## 101                0.113007   0.117107  0.11710722
## 102                0.113007   0.112195  0.11219520
## 103                0.113007   0.131439  0.13143960
## 104                0.113007   0.123680  0.12368050
## 105                0.113007   0.117506  0.11750612
## 106                0.113007   0.112534  0.11253450
## 107                0.113007   0.108358  0.10835850
## 108                0.113007   0.104709  0.10470928
## 109                0.113007   0.109238  0.10923807
## 110                0.113007   0.105483  0.10548315
## 111                0.113007   0.110802  0.11080233
## 112                0.113007   0.125724  0.12572413
## 113                0.113007   0.125102  0.12510209
## 114                0.113007   0.126776  0.12677640
## 115                0.113007   0.126115  0.12611476
## 116                0.113007   0.125433  0.12543312
## 117                0.113007   0.124736  0.12473538
## 118                0.113007   0.124106  0.12410594
## 119                0.113007   0.123545  0.12354479
## 120                0.113007   0.170072  0.17007238
## 121                0.113007   0.164727  0.16472667
## 122                0.113007   0.160297  0.16029663
## 123                0.113007   0.156678  0.15667830
## 124                0.113007   0.153736  0.15373552
## 125                0.113007   0.151100  0.15110030
## 126                0.113007   0.148893  0.14889310
## 127                0.113007   0.151003  0.15100329
## 128                0.113007   0.178346  0.17834565
## 129                0.113007   0.183576  0.18357652
## 130                0.113007   0.173767  0.17376727
## 131                0.113007   0.177622  0.17762181
## 132                0.113007   0.169889  0.16988881
## 133                0.113007   0.164378  0.16437780
## 134                0.113007   0.160117  0.16011697
## 135                0.113007   0.156559  0.15655867
## 136                0.113007   0.153534  0.15353369
## 137                0.113007   0.150963  0.15096327
## 138                0.113007   0.148670  0.14866995
## 139                0.113007   0.146590  0.14658978
## 140                0.113007   0.144885  0.14488502
## 141                0.113007   0.145334  0.14533393
## 142                0.113007   0.157182  0.15718160
## 143                0.113007   0.157818  0.15781843
## 144                0.113007   0.155109  0.15510969
## 145                0.113007   0.152972  0.15297210
## 146                0.113007   0.150487  0.15048695
## 147                0.113007   0.148272  0.14827192
## 148                0.113007   0.146271  0.14627136
## 149                0.113007   0.144462  0.14446176
## 150                0.113007   0.151109  0.15110856
validationsmNSElistsite2<- c()
validationsmlnNSElistsite2<- c()
validationsmKGElistsite2<- c()

#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site2"))))))
  validationsmKGElistsite2[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }

validationsmKGElistsite2
## [[1]]
## [1] 0.4838626
## 
## [[2]]
## [1] 0.1143625
## 
## [[3]]
## [1] 0.5174199
## 
## [[4]]
## [1] 0.1768435
## 
## [[5]]
## [1] 0.09378066
## 
## [[6]]
## [1] 0.4990256

RSS - Explore Site 2 ## not updated 6/27

# 
# 'Exploring Site 2 RSS'
# 
# 
# cwws32valrss2_run1
# 
# {plot(cwws32valrss2_run1$bd$date, (cwws32valrss2_run1$bd$rz_storage/cwws32valrss2_run1$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm1$Date,valmergesm1$Site2, col = 'BLUE', lty = 3)}
# 
# 
# 
# {plot(cwws32valrss2_run3$bd$date, (cwws32valrss2_run3$bd$rz_storage/cwws32valrss2_run3$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm3$Date,valmergesm3$Site2, col = 'BLUE', lty = 3)}
# 
# paste0("valmergesm",i,"$rootzonevwc")
# 
# plot((valmergesm3$root_zone.S*valmergesm3$potential_rz_store)/(valmergesm3$root.depth), type = "l")
# plot(valmergesm3$Date, (valmergesm3$rz_storage/valmergesm3$root.depth), type = "l")
# plot(valmergesm3$Date, valmergesm3$Site2, type = "l")
# 
# 
# {plot(cwws32valrss2_run3$pd$date, (cwws32valrss2_run3$pd$rz_storage/cwws32valrss2_run3$pd$root.depth), type = 'l', ylim = c(0.0,0.26))
# lines(valmergesm3$Date,valmergesm3$Site2, col = 'BLUE', lty = 3)}
# 
# 
# {plot(cwws32valrss2_run3$pd$date, ((cwws32valrss2_run3$pd$root_zone.S*cwws32valrss2_run3$pd$potential_rz_store)/cwws32valrss2_run3$pd$root.depth), type = 'l', ylim = c(0.0,0.26))
# lines(valmergesm3$Date,valmergesm3$Site2, col = 'BLUE', lty = 3)}
# 
# paste0("valmergesm",i,"$rootzonevwc")
# 
# 
# {plot(cwws32valrss2_run3$bd$date, (cwws32valrss2_run3$bd$rz_storage/cwws32valrss2_run3$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm3$Date,valmergesm3$Site2, col = 'BLUE', lty = 3)}
# 
# {plot(cwws32valrss2_run43$pd$date, (cwws32valrss2_run43$pd$rz_storage/cwws32valrss2_run43$pd$root.depth), type = 'l', ylim = c(0.0,0.26))
# lines(valmergesm43$Date,valmergesm43$Site2, col = 'BLUE', lty = 3)}
# 
# {plot(cwws32valrss2_run43$bd$date, (cwws32valrss2_run43$bd$rz_storage/cwws32valrss2_run43$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm1$Date,valmergesm1$Site2, col = 'BLUE', lty = 3)}

prepare to run model 20 times for patch 3 - only for validation time series

RSS - run model in parallel

RSS - read n runs, create table and append to table

setwd(system.file("extdata/", package = "RHESSysIOinR"))

# Read in RHESSys Validation runs
for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch3_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valrss3_run",i),temp_dataset)
}
##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valrss3_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}


validationsmNSElistsite3<- c()
validationsmlnNSElistsite3<- c()
validationsmKGElistsite3<- c()

#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site3"))))))
  validationsmKGElistsite3[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


validationsmKGElistsite3
## [[1]]
## [1] -0.9129287
## 
## [[2]]
## [1] NA
## 
## [[3]]
## [1] -0.5572772
## 
## [[4]]
## [1] -0.8505491
## 
## [[5]]
## [1] -0.2071186
## 
## [[6]]
## [1] -0.08493892
valmergesm2
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    110 149478  149478          1               0.205741
## 2         1    110 149478  149478          1               0.205741
## 3         1    110 149478  149478          1               0.205741
## 4         1    110 149478  149478          1               0.205741
## 5         1    110 149478  149478          1               0.205741
## 6         1    110 149478  149478          1               0.205741
## 7         1    110 149478  149478          1               0.205741
## 8         1    110 149478  149478          1               0.205741
## 9         1    110 149478  149478          1               0.205741
## 10        1    110 149478  149478          1               0.205741
## 11        1    110 149478  149478          1               0.205741
## 12        1    110 149478  149478          1               0.205741
## 13        1    110 149478  149478          1               0.205741
## 14        1    110 149478  149478          1               0.205741
## 15        1    110 149478  149478          1               0.205741
## 16        1    110 149478  149478          1               0.205741
## 17        1    110 149478  149478          1               0.205741
## 18        1    110 149478  149478          1               0.205741
## 19        1    110 149478  149478          1               0.205741
## 20        1    110 149478  149478          1               0.205741
## 21        1    110 149478  149478          1               0.205741
## 22        1    110 149478  149478          1               0.205741
## 23        1    110 149478  149478          1               0.205741
## 24        1    110 149478  149478          1               0.205741
## 25        1    110 149478  149478          1               0.205741
## 26        1    110 149478  149478          1               0.205741
## 27        1    110 149478  149478          1               0.205741
## 28        1    110 149478  149478          1               0.205741
## 29        1    110 149478  149478          1               0.205741
## 30        1    110 149478  149478          1               0.205741
## 31        1    110 149478  149478          1               0.205741
## 32        1    110 149478  149478          1               0.205741
## 33        1    110 149478  149478          1               0.205741
## 34        1    110 149478  149478          1               0.205741
## 35        1    110 149478  149478          1               0.205741
## 36        1    110 149478  149478          1               0.205741
## 37        1    110 149478  149478          1               0.205741
## 38        1    110 149478  149478          1               0.205741
## 39        1    110 149478  149478          1               0.205741
## 40        1    110 149478  149478          1               0.205741
## 41        1    110 149478  149478          1               0.205741
## 42        1    110 149478  149478          1               0.205741
## 43        1    110 149478  149478          1               0.205741
## 44        1    110 149478  149478          1               0.205741
## 45        1    110 149478  149478          1               0.205741
## 46        1    110 149478  149478          1               0.205741
## 47        1    110 149478  149478          1               0.205741
## 48        1    110 149478  149478          1               0.205741
## 49        1    110 149478  149478          1               0.205741
## 50        1    110 149478  149478          1               0.205741
## 51        1    110 149478  149478          1               0.205741
## 52        1    110 149478  149478          1               0.205741
## 53        1    110 149478  149478          1               0.205741
## 54        1    110 149478  149478          1               0.205741
## 55        1    110 149478  149478          1               0.205741
## 56        1    110 149478  149478          1               0.205741
## 57        1    110 149478  149478          1               0.205741
## 58        1    110 149478  149478          1               0.205741
## 59        1    110 149478  149478          1               0.205741
## 60        1    110 149478  149478          1               0.205741
## 61        1    110 149478  149478          1               0.205741
## 62        1    110 149478  149478          1               0.205741
## 63        1    110 149478  149478          1               0.205741
## 64        1    110 149478  149478          1               0.205741
## 65        1    110 149478  149478          1               0.205741
## 66        1    110 149478  149478          1               0.205741
## 67        1    110 149478  149478          1               0.205741
## 68        1    110 149478  149478          1               0.205741
## 69        1    110 149478  149478          1               0.205741
## 70        1    110 149478  149478          1               0.205741
## 71        1    110 149478  149478          1               0.205741
## 72        1    110 149478  149478          1               0.205741
## 73        1    110 149478  149478          1               0.205741
## 74        1    110 149478  149478          1               0.205741
## 75        1    110 149478  149478          1               0.205741
## 76        1    110 149478  149478          1               0.205741
## 77        1    110 149478  149478          1               0.205741
## 78        1    110 149478  149478          1               0.205741
## 79        1    110 149478  149478          1               0.205741
## 80        1    110 149478  149478          1               0.205741
## 81        1    110 149478  149478          1               0.205741
## 82        1    110 149478  149478          1               0.205741
## 83        1    110 149478  149478          1               0.205741
## 84        1    110 149478  149478          1               0.205741
## 85        1    110 149478  149478          1               0.205741
## 86        1    110 149478  149478          1               0.205741
## 87        1    110 149478  149478          1               0.205741
## 88        1    110 149478  149478          1               0.205741
## 89        1    110 149478  149478          1               0.205741
## 90        1    110 149478  149478          1               0.205741
## 91        1    110 149478  149478          1               0.205741
## 92        1    110 149478  149478          1               0.205741
## 93        1    110 149478  149478          1               0.205741
## 94        1    110 149478  149478          1               0.205741
## 95        1    110 149478  149478          1               0.205741
## 96        1    110 149478  149478          1               0.205741
## 97        1    110 149478  149478          1               0.205741
## 98        1    110 149478  149478          1               0.205741
## 99        1    110 149478  149478          1               0.205741
## 100       1    110 149478  149478          1               0.205741
## 101       1    110 149478  149478          1               0.205741
## 102       1    110 149478  149478          1               0.205741
## 103       1    110 149478  149478          1               0.205741
## 104       1    110 149478  149478          1               0.205741
## 105       1    110 149478  149478          1               0.205741
## 106       1    110 149478  149478          1               0.205741
## 107       1    110 149478  149478          1               0.205741
## 108       1    110 149478  149478          1               0.205741
## 109       1    110 149478  149478          1               0.205741
## 110       1    110 149478  149478          1               0.205741
## 111       1    110 149478  149478          1               0.205741
## 112       1    110 149478  149478          1               0.205741
## 113       1    110 149478  149478          1               0.205741
## 114       1    110 149478  149478          1               0.205741
## 115       1    110 149478  149478          1               0.205741
## 116       1    110 149478  149478          1               0.205741
## 117       1    110 149478  149478          1               0.205741
## 118       1    110 149478  149478          1               0.205741
## 119       1    110 149478  149478          1               0.205741
## 120       1    110 149478  149478          1               0.205741
## 121       1    110 149478  149478          1               0.205741
## 122       1    110 149478  149478          1               0.205741
## 123       1    110 149478  149478          1               0.205741
## 124       1    110 149478  149478          1               0.205741
## 125       1    110 149478  149478          1               0.205741
## 126       1    110 149478  149478          1               0.205741
## 127       1    110 149478  149478          1               0.205741
## 128       1    110 149478  149478          1               0.205741
## 129       1    110 149478  149478          1               0.205741
## 130       1    110 149478  149478          1               0.205741
## 131       1    110 149478  149478          1               0.205741
## 132       1    110 149478  149478          1               0.205741
## 133       1    110 149478  149478          1               0.205741
## 134       1    110 149478  149478          1               0.205741
## 135       1    110 149478  149478          1               0.205741
## 136       1    110 149478  149478          1               0.205741
## 137       1    110 149478  149478          1               0.205741
## 138       1    110 149478  149478          1               0.205741
## 139       1    110 149478  149478          1               0.205741
## 140       1    110 149478  149478          1               0.205741
## 141       1    110 149478  149478          1               0.205741
## 142       1    110 149478  149478          1               0.205741
## 143       1    110 149478  149478          1               0.205741
## 144       1    110 149478  149478          1               0.205741
## 145       1    110 149478  149478          1               0.205741
## 146       1    110 149478  149478          1               0.205741
## 147       1    110 149478  149478          1               0.205741
## 148       1    110 149478  149478          1               0.205741
## 149       1    110 149478  149478          1               0.205741
## 150       1    110 149478  149478          1               0.205741
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                         0          0    0.205741
## 2                         0          0    0.205741
## 3                         0          0    0.205741
## 4                         0          0    0.205741
## 5                         0          0    0.205741
## 6                         0          0    0.205741
## 7                         0          0    0.205741
## 8                         0          0    0.205741
## 9                         0          0    0.205741
## 10                        0          0    0.205741
## 11                        0          0    0.205741
## 12                        0          0    0.205741
## 13                        0          0    0.205741
## 14                        0          0    0.205741
## 15                        0          0    0.205741
## 16                        0          0    0.205741
## 17                        0          0    0.205741
## 18                        0          0    0.205741
## 19                        0          0    0.205741
## 20                        0          0    0.205741
## 21                        0          0    0.205741
## 22                        0          0    0.205741
## 23                        0          0    0.205741
## 24                        0          0    0.205741
## 25                        0          0    0.205741
## 26                        0          0    0.205741
## 27                        0          0    0.205741
## 28                        0          0    0.205741
## 29                        0          0    0.205741
## 30                        0          0    0.205741
## 31                        0          0    0.205741
## 32                        0          0    0.205741
## 33                        0          0    0.205741
## 34                        0          0    0.205741
## 35                        0          0    0.205741
## 36                        0          0    0.205741
## 37                        0          0    0.205741
## 38                        0          0    0.205741
## 39                        0          0    0.205741
## 40                        0          0    0.205741
## 41                        0          0    0.205741
## 42                        0          0    0.205741
## 43                        0          0    0.205741
## 44                        0          0    0.205741
## 45                        0          0    0.205741
## 46                        0          0    0.205741
## 47                        0          0    0.205741
## 48                        0          0    0.205741
## 49                        0          0    0.205741
## 50                        0          0    0.205741
## 51                        0          0    0.205741
## 52                        0          0    0.205741
## 53                        0          0    0.205741
## 54                        0          0    0.205741
## 55                        0          0    0.205741
## 56                        0          0    0.205741
## 57                        0          0    0.205741
## 58                        0          0    0.205741
## 59                        0          0    0.205741
## 60                        0          0    0.205741
## 61                        0          0    0.205741
## 62                        0          0    0.205741
## 63                        0          0    0.205741
## 64                        0          0    0.205741
## 65                        0          0    0.205741
## 66                        0          0    0.205741
## 67                        0          0    0.205741
## 68                        0          0    0.205741
## 69                        0          0    0.205741
## 70                        0          0    0.205741
## 71                        0          0    0.205741
## 72                        0          0    0.205741
## 73                        0          0    0.205741
## 74                        0          0    0.205741
## 75                        0          0    0.205741
## 76                        0          0    0.205741
## 77                        0          0    0.205741
## 78                        0          0    0.205741
## 79                        0          0    0.205741
## 80                        0          0    0.205741
## 81                        0          0    0.205741
## 82                        0          0    0.205741
## 83                        0          0    0.205741
## 84                        0          0    0.205741
## 85                        0          0    0.205741
## 86                        0          0    0.205741
## 87                        0          0    0.205741
## 88                        0          0    0.205741
## 89                        0          0    0.205741
## 90                        0          0    0.205741
## 91                        0          0    0.205741
## 92                        0          0    0.205741
## 93                        0          0    0.205741
## 94                        0          0    0.205741
## 95                        0          0    0.205741
## 96                        0          0    0.205741
## 97                        0          0    0.205741
## 98                        0          0    0.205741
## 99                        0          0    0.205741
## 100                       0          0    0.205741
## 101                       0          0    0.205741
## 102                       0          0    0.205741
## 103                       0          0    0.205741
## 104                       0          0    0.205741
## 105                       0          0    0.205741
## 106                       0          0    0.205741
## 107                       0          0    0.205741
## 108                       0          0    0.205741
## 109                       0          0    0.205741
## 110                       0          0    0.205741
## 111                       0          0    0.205741
## 112                       0          0    0.205741
## 113                       0          0    0.205741
## 114                       0          0    0.205741
## 115                       0          0    0.205741
## 116                       0          0    0.205741
## 117                       0          0    0.205741
## 118                       0          0    0.205741
## 119                       0          0    0.205741
## 120                       0          0    0.205741
## 121                       0          0    0.205741
## 122                       0          0    0.205741
## 123                       0          0    0.205741
## 124                       0          0    0.205741
## 125                       0          0    0.205741
## 126                       0          0    0.205741
## 127                       0          0    0.205741
## 128                       0          0    0.205741
## 129                       0          0    0.205741
## 130                       0          0    0.205741
## 131                       0          0    0.205741
## 132                       0          0    0.205741
## 133                       0          0    0.205741
## 134                       0          0    0.205741
## 135                       0          0    0.205741
## 136                       0          0    0.205741
## 137                       0          0    0.205741
## 138                       0          0    0.205741
## 139                       0          0    0.205741
## 140                       0          0    0.205741
## 141                       0          0    0.205741
## 142                       0          0    0.205741
## 143                       0          0    0.205741
## 144                       0          0    0.205741
## 145                       0          0    0.205741
## 146                       0          0    0.205741
## 147                       0          0    0.205741
## 148                       0          0    0.205741
## 149                       0          0    0.205741
## 150                       0          0    0.205741

RSS - Explore Site 3 #not updated 6/27

# 
# 'Exploring Site 3 RSS'
# 
# 
# cwws32valrss3_run1
# 
# {plot(cwws32valrss3_run1$bd$date, (cwws32valrss3_run1$bd$rz_storage/cwws32valrss3_run1$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm1$Date,valmergesm1$Site3, col = 'BLUE', lty = 3)}
# 
# 
# 
# {plot(cwws32valrss3_run3$bd$date, (cwws32valrss3_run3$bd$rz_storage/cwws32valrss3_run3$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm3$Date,valmergesm3$Site3, col = 'BLUE', lty = 3)}
# 
# paste0("valmergesm",i,"$rootzonevwc")
# 
# plot((valmergesm3$root_zone.S*valmergesm3$potential_rz_store)/(valmergesm3$root.depth), type = "l")
# plot(valmergesm3$Date, (valmergesm3$rz_storage/valmergesm3$root.depth), type = "l")
# plot(valmergesm3$Date, valmergesm3$Site3, type = "l")
# 
# 
# {plot(cwws32valrss3_run3$pd$date, (cwws32valrss3_run3$pd$rz_storage/cwws32valrss3_run3$pd$root.depth), type = 'l', ylim = c(0.0,0.45))
# lines(valmergesm3$Date,valmergesm3$Site3, col = 'BLUE', lty = 3)}
# 
# 
# {plot(cwws32valrss3_run3$pd$date, ((cwws32valrss3_run3$pd$root_zone.S*cwws32valrss3_run3$pd$potential_rz_store)/cwws32valrss3_run3$pd$root.depth), type = 'l', ylim = c(0.0,0.45))
# lines(valmergesm3$Date,valmergesm3$Site3, col = 'BLUE', lty = 3)}
# 
# ## based on landscape position the previous two figures differ, the second figure does not count inundation as "0" VWC
# 
# #paste0("valmergesm",i,"$rootzonevwc")
# 
# 
# {plot(cwws32valrss3_run3$bd$date, (cwws32valrss3_run3$bd$rz_storage/cwws32valrss3_run3$bd$rootdepth), type = 'l', ylim = c(0.0,0.45))
# lines(valmergesm3$Date,valmergesm3$Site3, col = 'BLUE', lty = 3)}
# 
# {plot(cwws32valrss3_run43$pd$date, (cwws32valrss3_run43$pd$rz_storage/cwws32valrss3_run43$pd$root.depth), type = 'l', ylim = c(0.0,0.35))
# lines(valmergesm43$Date,valmergesm43$Site3, col = 'BLUE', lty = 3)}
# 
# {plot(cwws32valrss3_run43$bd$date, (cwws32valrss3_run43$bd$rz_storage/cwws32valrss3_run43$bd$rootdepth), type = 'l', ylim = c(0.12,0.26))
# lines(valmergesm1$Date,valmergesm1$Site3, col = 'BLUE', lty = 3)}

RSS - merge all 3 sites

setwd(system.file("extdata/", package = "RHESSysIOinR"))

threesitevalidation1<- data.frame(cbind(site1=as.numeric(validationsmKGElistsite1),site2=as.numeric(validationsmKGElistsite2),site3=as.numeric(validationsmKGElistsite3)))


threesitevalidation<-threesitevalidation1

threesitevalidation$allsites<- rowMeans(threesitevalidation1,na.rm=FALSE)

threesitevalidation
##          site1      site2       site3    allsites
## 1 -0.157272838 0.48386257 -0.91292868 -0.19544631
## 2  0.009899872 0.11436255          NA          NA
## 3 -0.149258136 0.51741992 -0.55727721 -0.06303847
## 4 -0.050589156 0.17684348 -0.85054907 -0.24143158
## 5 -0.060160453 0.09378066 -0.20711859 -0.05783279
## 6 -0.261547943 0.49902564 -0.08493892  0.05084626
boxplot(threesitevalidation1, main = "Boxplot of Patch Specific Soil Moisture KGE - RSS")

boxplot(threesitevalidation, main = "Boxplot of Patch Specific Soil Moisture KGE - RSS")

plot(validationsmKGElistsite1,validationsmKGElistsite3)

write.csv(threesitevalidation,'threesitevalidationrss.csv')

STATIC

run model n times for patch 1 - only for validation time series

setwd(system.file("extdata/", package = "RHESSysIOinR"))

input_rhessys = IOin_rhessys_input(
  version = rh_path,
  tec_file = "tecfiles/tec_daily",
  world_file = "CWWS32static.world.Y2018M11D1H1.state.Y2018M11D1H1.state",
  world_hdr_prefix = "CWWS32static",
  flowtable = "CWWS32static.flow",
  start = "2015 11 1 1",
  end = "2018 11 1 1",
  output_folder = "out",
  output_prefix = "cwws32valstatic1",
commandline_options = c(""))

input_tec_data = IOin_tec_std(start = "2017 11 1 1",
                              end = "2018 11 1 1",
                              output_state = FALSE)

input_hdr = IOin_hdr(
  basin = "defs/basin.def",
  hillslope = "defs/hillslope.def",
  zone = "defs/zone.def",
  soil = c("defs/soil_clay.def","defs/soil_clayloam.def","defs/soil_loam.def","defs/soil_loamysand.def","defs/soil_rock.def","defs/soil_sand.def","defs/soil_sandyclay.def","defs/soil_sandyclayloam.def","defs/soil_sandyloam.def","defs/soil_silt.def","defs/soil_siltyclay.def","defs/soil_siltyclayloam.def","defs/soil_siltyloam.def","defs/soil_water.def", "defs/soil_shallowloam.def", "defs/soil_shallowsandyclayloam.def", "defs/soil_shallowsandyloam.def"),
  landuse = "defs/lu_undev.def",
  stratum = c("defs/veg_deciduous/veg_deciduous.def","defs/veg_evergreen/veg_evergreen.def","defs/veg_deciduous_BES.def","defs/veg_eucalypt.def","defs/veg_grass.def","defs/veg_lawn_2cm.def","defs/veg_lawn_5cm.def","defs/veg_lawn_10cm.def","defs/veg_nonveg.def"),
  basestations = "clim/cwtws32local.base")

run static

setwd(system.file("extdata/", package = "RHESSysIOinR"))

n.cores <- parallel::detectCores() - 4  
  
my.cluster <- parallel::makeCluster(
    n.cores, 
    type = "PSOCK"
  )
doParallel::registerDoParallel(cl = my.cluster)

start_time = Sys.time()
  
  foreach(i = 1:validationruns, .packages = 'RHESSysIOinR') %dopar% {
    
    stdpars<- IOin_cmd_pars(m = topstatic[i,]$m,
                            k = topstatic[i,]$k,
                            soil_dep= topstatic[i,]$soil_dep,
                            m_v = topstatic[i,]$m_v,
                            k_v = topstatic[i,]$k_v,
                            gw1 = topstatic[i,]$gw1,
                            gw2 = topstatic[i,]$gw2,
                            pa = topstatic[i,]$pa,
                            po = topstatic[i,]$po,
                            vgseng1 = topstatic[i,]$vgseng1,
                            vgseng2 = topstatic[i,]$vgseng2,
                            vgseng3 = topstatic[i,]$vgseng3)
    
    run_rhessys_single(input_rhessys = input_rhessys,
                       hdr_files = input_hdr,
                       tec_data = input_tec_data,
                       cmd_pars = stdpars,
                       output_filter = c(patchfilterpatch1,patchfilterpatch2,patchfilterpatch3),
                       runID = i)
  } 
## [[1]]
## NULL
## 
## [[2]]
## NULL
## 
## [[3]]
## NULL
## 
## [[4]]
## NULL
## 
## [[5]]
## NULL
## 
## [[6]]
## NULL
  end_time = Sys.time()
  end_time - start_time
## Time difference of 3.345658 mins

read 20 runs, create table and append to table for patch 1

setwd(system.file("extdata/", package = "RHESSysIOinR"))

# Read in RHESSys Validation runs

for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch1_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valstatic1_run",i),temp_dataset)
}

##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valstatic1_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}

valmergesm1
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    112 136557  136557   0.233190                  0.451
## 2         1    112 136557  136557   0.234504                  0.451
## 3         1    112 136557  136557   0.226849                  0.451
## 4         1    112 136557  136557   0.283153                  0.451
## 5         1    112 136557  136557   0.265445                  0.451
## 6         1    112 136557  136557   0.275756                  0.451
## 7         1    112 136557  136557   0.315617                  0.451
## 8         1    112 136557  136557   0.288796                  0.451
## 9         1    112 136557  136557   0.269027                  0.451
## 10        1    112 136557  136557   0.253984                  0.451
## 11        1    112 136557  136557   0.241995                  0.451
## 12        1    112 136557  136557   0.232132                  0.451
## 13        1    112 136557  136557   0.223829                  0.451
## 14        1    112 136557  136557   0.216714                  0.451
## 15        1    112 136557  136557   0.210529                  0.451
## 16        1    112 136557  136557   0.205092                  0.451
## 17        1    112 136557  136557   0.200265                  0.451
## 18        1    112 136557  136557   0.195946                  0.451
## 19        1    112 136557  136557   0.192053                  0.451
## 20        1    112 136557  136557   0.188523                  0.451
## 21        1    112 136557  136557   0.185307                  0.451
## 22        1    112 136557  136557   0.182361                  0.451
## 23        1    112 136557  136557   0.184350                  0.451
## 24        1    112 136557  136557   0.181995                  0.451
## 25        1    112 136557  136557   0.187582                  0.451
## 26        1    112 136557  136557   0.333007                  0.451
## 27        1    112 136557  136557   0.386849                  0.451
## 28        1    112 136557  136557   0.324715                  0.451
## 29        1    112 136557  136557   0.295260                  0.451
## 30        1    112 136557  136557   0.274915                  0.451
## 31        1    112 136557  136557   0.275968                  0.451
## 32        1    112 136557  136557   0.260209                  0.451
## 33        1    112 136557  136557   0.246922                  0.451
## 34        1    112 136557  136557   0.236112                  0.451
## 35        1    112 136557  136557   0.227084                  0.451
## 36        1    112 136557  136557   0.219394                  0.451
## 37        1    112 136557  136557   0.268937                  0.451
## 38        1    112 136557  136557   0.269813                  0.451
## 39        1    112 136557  136557   0.255176                  0.451
## 40        1    112 136557  136557   0.242848                  0.451
## 41        1    112 136557  136557   0.232711                  0.451
## 42        1    112 136557  136557   0.258353                  0.451
## 43        1    112 136557  136557   0.306098                  0.451
## 44        1    112 136557  136557   0.282134                  0.451
## 45        1    112 136557  136557   0.263991                  0.451
## 46        1    112 136557  136557   0.249910                  0.451
## 47        1    112 136557  136557   0.255403                  0.451
## 48        1    112 136557  136557   0.243486                  0.451
## 49        1    112 136557  136557   0.233218                  0.451
## 50        1    112 136557  136557   0.296423                  0.451
## 51        1    112 136557  136557   0.275054                  0.451
## 52        1    112 136557  136557   0.278357                  0.451
## 53        1    112 136557  136557   0.359925                  0.451
## 54        1    112 136557  136557   0.313575                  0.451
## 55        1    112 136557  136557   0.287682                  0.451
## 56        1    112 136557  136557   0.415030                  0.451
## 57        1    112 136557  136557   0.337243                  0.451
## 58        1    112 136557  136557   0.354858                  0.451
## 59        1    112 136557  136557   0.354997                  0.451
## 60        1    112 136557  136557   0.311160                  0.451
## 61        1    112 136557  136557   0.325414                  0.451
## 62        1    112 136557  136557   0.295772                  0.451
## 63        1    112 136557  136557   0.318786                  0.451
## 64        1    112 136557  136557   0.323604                  0.451
## 65        1    112 136557  136557   0.326670                  0.451
## 66        1    112 136557  136557   0.331489                  0.451
## 67        1    112 136557  136557   0.390326                  0.451
## 68        1    112 136557  136557   0.325825                  0.451
## 69        1    112 136557  136557   0.296192                  0.451
## 70        1    112 136557  136557   0.296428                  0.451
## 71        1    112 136557  136557   0.314387                  0.451
## 72        1    112 136557  136557   0.321344                  0.451
## 73        1    112 136557  136557   0.321344                  0.451
## 74        1    112 136557  136557   0.371609                  0.451
## 75        1    112 136557  136557   0.412083                  0.451
## 76        1    112 136557  136557   0.393795                  0.451
## 77        1    112 136557  136557   0.380779                  0.451
## 78        1    112 136557  136557   0.370689                  0.451
## 79        1    112 136557  136557   0.362587                  0.451
## 80        1    112 136557  136557   0.385690                  0.451
## 81        1    112 136557  136557   0.377066                  0.451
## 82        1    112 136557  136557   0.368167                  0.451
## 83        1    112 136557  136557   0.360411                  0.451
## 84        1    112 136557  136557   0.354089                  0.451
## 85        1    112 136557  136557   0.353688                  0.451
## 86        1    112 136557  136557   0.367045                  0.451
## 87        1    112 136557  136557   0.359598                  0.451
## 88        1    112 136557  136557   0.353402                  0.451
## 89        1    112 136557  136557   0.347544                  0.451
## 90        1    112 136557  136557   0.342453                  0.451
## 91        1    112 136557  136557   0.352428                  0.451
## 92        1    112 136557  136557   0.346692                  0.451
## 93        1    112 136557  136557   0.369299                  0.451
## 94        1    112 136557  136557   0.375717                  0.451
## 95        1    112 136557  136557   0.368015                  0.451
## 96        1    112 136557  136557   0.360365                  0.451
## 97        1    112 136557  136557   0.353738                  0.451
## 98        1    112 136557  136557   0.371314                  0.451
## 99        1    112 136557  136557   0.373867                  0.451
## 100       1    112 136557  136557   0.365307                  0.451
## 101       1    112 136557  136557   0.358110                  0.451
## 102       1    112 136557  136557   0.351718                  0.451
## 103       1    112 136557  136557   0.385633                  0.451
## 104       1    112 136557  136557   0.374451                  0.451
## 105       1    112 136557  136557   0.365460                  0.451
## 106       1    112 136557  136557   0.357891                  0.451
## 107       1    112 136557  136557   0.351432                  0.451
## 108       1    112 136557  136557   0.345956                  0.451
## 109       1    112 136557  136557   0.351039                  0.451
## 110       1    112 136557  136557   0.345343                  0.451
## 111       1    112 136557  136557   0.352130                  0.451
## 112       1    112 136557  136557   0.377873                  0.451
## 113       1    112 136557  136557   0.368373                  0.451
## 114       1    112 136557  136557   0.365417                  0.451
## 115       1    112 136557  136557   0.358048                  0.451
## 116       1    112 136557  136557   0.351617                  0.451
## 117       1    112 136557  136557   0.345886                  0.451
## 118       1    112 136557  136557   0.340928                  0.451
## 119       1    112 136557  136557   0.337243                  0.451
## 120       1    112 136557  136557   0.426088                  0.451
## 121       1    112 136557  136557   0.402695                  0.451
## 122       1    112 136557  136557   0.386768                  0.451
## 123       1    112 136557  136557   0.374950                  0.451
## 124       1    112 136557  136557   0.365861                  0.451
## 125       1    112 136557  136557   0.358070                  0.451
## 126       1    112 136557  136557   0.351729                  0.451
## 127       1    112 136557  136557   0.355286                  0.451
## 128       1    112 136557  136557   0.413969                  0.451
## 129       1    112 136557  136557   0.424032                  0.451
## 130       1    112 136557  136557   0.401252                  0.451
## 131       1    112 136557  136557   0.409294                  0.451
## 132       1    112 136557  136557   0.391587                  0.451
## 133       1    112 136557  136557   0.378893                  0.451
## 134       1    112 136557  136557   0.369040                  0.451
## 135       1    112 136557  136557   0.360684                  0.451
## 136       1    112 136557  136557   0.353545                  0.451
## 137       1    112 136557  136557   0.347490                  0.451
## 138       1    112 136557  136557   0.342053                  0.451
## 139       1    112 136557  136557   0.337243                  0.451
## 140       1    112 136557  136557   0.337243                  0.451
## 141       1    112 136557  136557   0.339366                  0.451
## 142       1    112 136557  136557   0.365103                  0.451
## 143       1    112 136557  136557   0.365944                  0.451
## 144       1    112 136557  136557   0.359451                  0.451
## 145       1    112 136557  136557   0.354295                  0.451
## 146       1    112 136557  136557   0.347540                  0.451
## 147       1    112 136557  136557   0.341473                  0.451
## 148       1    112 136557  136557   0.337243                  0.451
## 149       1    112 136557  136557   0.337243                  0.451
## 150       1    112 136557  136557   0.352724                  0.451
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.152097   0.105169  0.10516869
## 2                  0.152097   0.105761  0.10576130
## 3                  0.152097   0.102309  0.10230890
## 4                  0.152097   0.127702  0.12770200
## 5                  0.152097   0.119716  0.11971569
## 6                  0.152097   0.124366  0.12436596
## 7                  0.152097   0.142343  0.14234327
## 8                  0.152097   0.130247  0.13024700
## 9                  0.152097   0.121331  0.12133118
## 10                 0.152097   0.114547  0.11454678
## 11                 0.152097   0.109140  0.10913974
## 12                 0.152097   0.104692  0.10469153
## 13                 0.152097   0.100947  0.10094688
## 14                 0.152097   0.097738  0.09773801
## 15                 0.152097   0.094949  0.09494858
## 16                 0.152097   0.092497  0.09249649
## 17                 0.152097   0.090320  0.09031952
## 18                 0.152097   0.088372  0.08837165
## 19                 0.152097   0.086616  0.08661590
## 20                 0.152097   0.085024  0.08502387
## 21                 0.152097   0.083573  0.08357346
## 22                 0.152097   0.082245  0.08224481
## 23                 0.152097   0.083142  0.08314185
## 24                 0.152097   0.082080  0.08207974
## 25                 0.152097   0.084599  0.08459948
## 26                 0.152097   0.150186  0.15018616
## 27                 0.152097   0.174469  0.17446890
## 28                 0.152097   0.146447  0.14644646
## 29                 0.152097   0.133162  0.13316226
## 30                 0.152097   0.123986  0.12398667
## 31                 0.152097   0.124461  0.12446157
## 32                 0.152097   0.117354  0.11735426
## 33                 0.152097   0.111362  0.11136182
## 34                 0.152097   0.106487  0.10648651
## 35                 0.152097   0.102415  0.10241488
## 36                 0.152097   0.098947  0.09894669
## 37                 0.152097   0.121291  0.12129059
## 38                 0.152097   0.121686  0.12168566
## 39                 0.152097   0.115084  0.11508438
## 40                 0.152097   0.109525  0.10952445
## 41                 0.152097   0.104953  0.10495266
## 42                 0.152097   0.116517  0.11651720
## 43                 0.152097   0.138050  0.13805020
## 44                 0.152097   0.127242  0.12724243
## 45                 0.152097   0.119060  0.11905994
## 46                 0.152097   0.112710  0.11270941
## 47                 0.152097   0.115187  0.11518675
## 48                 0.152097   0.109812  0.10981219
## 49                 0.152097   0.105181  0.10518132
## 50                 0.152097   0.133687  0.13368677
## 51                 0.152097   0.124049  0.12404935
## 52                 0.152097   0.125539  0.12553901
## 53                 0.152097   0.162326  0.16232617
## 54                 0.152097   0.141422  0.14142232
## 55                 0.152097   0.129745  0.12974458
## 56                 0.152097   0.187178  0.18717853
## 57                 0.152097   0.152097  0.15209659
## 58                 0.152097   0.160041  0.16004096
## 59                 0.152097   0.160104  0.16010365
## 60                 0.152097   0.140333  0.14033316
## 61                 0.152097   0.146762  0.14676171
## 62                 0.152097   0.133393  0.13339317
## 63                 0.152097   0.143772  0.14377249
## 64                 0.152097   0.145945  0.14594540
## 65                 0.152097   0.147328  0.14732817
## 66                 0.152097   0.149501  0.14950154
## 67                 0.152097   0.176037  0.17603703
## 68                 0.152097   0.146947  0.14694707
## 69                 0.152097   0.133582  0.13358259
## 70                 0.152097   0.133689  0.13368903
## 71                 0.152097   0.141789  0.14178854
## 72                 0.152097   0.144926  0.14492614
## 73                 0.152097   0.144926  0.14492614
## 74                 0.152097   0.167596  0.16759566
## 75                 0.152097   0.185850  0.18584943
## 76                 0.152097   0.177602  0.17760154
## 77                 0.152097   0.171732  0.17173133
## 78                 0.152097   0.167181  0.16718074
## 79                 0.152097   0.163527  0.16352674
## 80                 0.152097   0.173946  0.17394619
## 81                 0.152097   0.170057  0.17005677
## 82                 0.152097   0.166043  0.16604332
## 83                 0.152097   0.162545  0.16254536
## 84                 0.152097   0.159694  0.15969414
## 85                 0.152097   0.159513  0.15951329
## 86                 0.152097   0.165538  0.16553730
## 87                 0.152097   0.162179  0.16217870
## 88                 0.152097   0.159384  0.15938430
## 89                 0.152097   0.156743  0.15674234
## 90                 0.152097   0.154446  0.15444630
## 91                 0.152097   0.158945  0.15894503
## 92                 0.152097   0.156358  0.15635809
## 93                 0.152097   0.166554  0.16655385
## 94                 0.152097   0.169448  0.16944837
## 95                 0.152097   0.165975  0.16597476
## 96                 0.152097   0.162525  0.16252462
## 97                 0.152097   0.159536  0.15953584
## 98                 0.152097   0.167463  0.16746261
## 99                 0.152097   0.168614  0.16861402
## 100                0.152097   0.164753  0.16475346
## 101                0.152097   0.161508  0.16150761
## 102                0.152097   0.158625  0.15862482
## 103                0.152097   0.173921  0.17392048
## 104                0.152097   0.168878  0.16887740
## 105                0.152097   0.164823  0.16482246
## 106                0.152097   0.161409  0.16140884
## 107                0.152097   0.158496  0.15849583
## 108                0.152097   0.156026  0.15602616
## 109                0.152097   0.158319  0.15831859
## 110                0.152097   0.155750  0.15574969
## 111                0.152097   0.158811  0.15881063
## 112                0.152097   0.170421  0.17042072
## 113                0.152097   0.166136  0.16613622
## 114                0.152097   0.164803  0.16480307
## 115                0.152097   0.161480  0.16147965
## 116                0.152097   0.158579  0.15857927
## 117                0.152097   0.155994  0.15599459
## 118                0.152097   0.153758  0.15375853
## 119                0.152097   0.152097  0.15209659
## 120                0.152097   0.192166  0.19216569
## 121                0.152097   0.181615  0.18161545
## 122                0.152097   0.174432  0.17443237
## 123                0.152097   0.169103  0.16910245
## 124                0.152097   0.165003  0.16500331
## 125                0.152097   0.161490  0.16148957
## 126                0.152097   0.158630  0.15862978
## 127                0.152097   0.160234  0.16023399
## 128                0.152097   0.186700  0.18670002
## 129                0.152097   0.191238  0.19123843
## 130                0.152097   0.180965  0.18096465
## 131                0.152097   0.184592  0.18459159
## 132                0.152097   0.176606  0.17660574
## 133                0.152097   0.170881  0.17088074
## 134                0.152097   0.166437  0.16643704
## 135                0.152097   0.162669  0.16266848
## 136                0.152097   0.159449  0.15944880
## 137                0.152097   0.156718  0.15671799
## 138                0.152097   0.154266  0.15426590
## 139                0.152097   0.152097  0.15209659
## 140                0.152097   0.152097  0.15209659
## 141                0.152097   0.153054  0.15305407
## 142                0.152097   0.164662  0.16466145
## 143                0.152097   0.165041  0.16504074
## 144                0.152097   0.162113  0.16211240
## 145                0.152097   0.159787  0.15978705
## 146                0.152097   0.156741  0.15674054
## 147                0.152097   0.154004  0.15400432
## 148                0.152097   0.152097  0.15209659
## 149                0.152097   0.152097  0.15209659
## 150                0.152097   0.159079  0.15907852
validationsmNSElistsite1<- c()
validationsmlnNSElistsite1<- c()
validationsmKGElistsite1<- c()


#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site1"))))))
  validationsmKGElistsite1[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }

validationsmKGElistsite1
## [[1]]
## [1] 0.4600128
## 
## [[2]]
## [1] -0.1868718
## 
## [[3]]
## [1] 0.1401158
## 
## [[4]]
## [1] 0.01728628
## 
## [[5]]
## [1] -0.714845
## 
## [[6]]
## [1] -0.7186982

prepare to run model 20 times for patch 2 - only for validation time series

run model in parallel

read 20 runs, create table and append to table

setwd(system.file("extdata/", package = "RHESSysIOinR"))

# Read in RHESSys Validation runs

for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch2_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valstatic2_run",i),temp_dataset)
}

##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valstatic2_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}


valmergesm1
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    110 141942  141942   0.229837                  0.451
## 2         1    110 141942  141942   0.231151                  0.451
## 3         1    110 141942  141942   0.223890                  0.451
## 4         1    110 141942  141942   0.280364                  0.451
## 5         1    110 141942  141942   0.263327                  0.451
## 6         1    110 141942  141942   0.273807                  0.451
## 7         1    110 141942  141942   0.313668                  0.451
## 8         1    110 141942  141942   0.287520                  0.451
## 9         1    110 141942  141942   0.268125                  0.451
## 10        1    110 141942  141942   0.253290                  0.451
## 11        1    110 141942  141942   0.241425                  0.451
## 12        1    110 141942  141942   0.231639                  0.451
## 13        1    110 141942  141942   0.223384                  0.451
## 14        1    110 141942  141942   0.216298                  0.451
## 15        1    110 141942  141942   0.210130                  0.451
## 16        1    110 141942  141942   0.204701                  0.451
## 17        1    110 141942  141942   0.199878                  0.451
## 18        1    110 141942  141942   0.195559                  0.451
## 19        1    110 141942  141942   0.191664                  0.451
## 20        1    110 141942  141942   0.188131                  0.451
## 21        1    110 141942  141942   0.184910                  0.451
## 22        1    110 141942  141942   0.181960                  0.451
## 23        1    110 141942  141942   0.184118                  0.451
## 24        1    110 141942  141942   0.181730                  0.451
## 25        1    110 141942  141942   0.187207                  0.451
## 26        1    110 141942  141942   0.332633                  0.451
## 27        1    110 141942  141942   0.386534                  0.451
## 28        1    110 141942  141942   0.324653                  0.451
## 29        1    110 141942  141942   0.295145                  0.451
## 30        1    110 141942  141942   0.274721                  0.451
## 31        1    110 141942  141942   0.276285                  0.451
## 32        1    110 141942  141942   0.260414                  0.451
## 33        1    110 141942  141942   0.247101                  0.451
## 34        1    110 141942  141942   0.236265                  0.451
## 35        1    110 141942  141942   0.227211                  0.451
## 36        1    110 141942  141942   0.228717                  0.451
## 37        1    110 141942  141942   0.276024                  0.451
## 38        1    110 141942  141942   0.276900                  0.451
## 39        1    110 141942  141942   0.260731                  0.451
## 40        1    110 141942  141942   0.247336                  0.451
## 41        1    110 141942  141942   0.236436                  0.451
## 42        1    110 141942  141942   0.262247                  0.451
## 43        1    110 141942  141942   0.309993                  0.451
## 44        1    110 141942  141942   0.284884                  0.451
## 45        1    110 141942  141942   0.266093                  0.451
## 46        1    110 141942  141942   0.251591                  0.451
## 47        1    110 141942  141942   0.257253                  0.451
## 48        1    110 141942  141942   0.244981                  0.451
## 49        1    110 141942  141942   0.234462                  0.451
## 50        1    110 141942  141942   0.297727                  0.451
## 51        1    110 141942  141942   0.276023                  0.451
## 52        1    110 141942  141942   0.279495                  0.451
## 53        1    110 141942  141942   0.360965                  0.451
## 54        1    110 141942  141942   0.314085                  0.451
## 55        1    110 141942  141942   0.287994                  0.451
## 56        1    110 141942  141942   0.415353                  0.451
## 57        1    110 141942  141942   0.337243                  0.451
## 58        1    110 141942  141942   0.354858                  0.451
## 59        1    110 141942  141942   0.354997                  0.451
## 60        1    110 141942  141942   0.311147                  0.451
## 61        1    110 141942  141942   0.325569                  0.451
## 62        1    110 141942  141942   0.295821                  0.451
## 63        1    110 141942  141942   0.319005                  0.451
## 64        1    110 141942  141942   0.323823                  0.451
## 65        1    110 141942  141942   0.326889                  0.451
## 66        1    110 141942  141942   0.331708                  0.451
## 67        1    110 141942  141942   0.390506                  0.451
## 68        1    110 141942  141942   0.325886                  0.451
## 69        1    110 141942  141942   0.296170                  0.451
## 70        1    110 141942  141942   0.296576                  0.451
## 71        1    110 141942  141942   0.314535                  0.451
## 72        1    110 141942  141942   0.321544                  0.451
## 73        1    110 141942  141942   0.293389                  0.451
## 74        1    110 141942  141942   0.346202                  0.451
## 75        1    110 141942  141942   0.394214                  0.451
## 76        1    110 141942  141942   0.327011                  0.451
## 77        1    110 141942  141942   0.296979                  0.451
## 78        1    110 141942  141942   0.276488                  0.451
## 79        1    110 141942  141942   0.261264                  0.451
## 80        1    110 141942  141942   0.294522                  0.451
## 81        1    110 141942  141942   0.296712                  0.451
## 82        1    110 141942  141942   0.276318                  0.451
## 83        1    110 141942  141942   0.261153                  0.451
## 84        1    110 141942  141942   0.249297                  0.451
## 85        1    110 141942  141942   0.254522                  0.451
## 86        1    110 141942  141942   0.274454                  0.451
## 87        1    110 141942  141942   0.259725                  0.451
## 88        1    110 141942  141942   0.248157                  0.451
## 89        1    110 141942  141942   0.238774                  0.451
## 90        1    110 141942  141942   0.230982                  0.451
## 91        1    110 141942  141942   0.245843                  0.451
## 92        1    110 141942  141942   0.236853                  0.451
## 93        1    110 141942  141942   0.266169                  0.451
## 94        1    110 141942  141942   0.281500                  0.451
## 95        1    110 141942  141942   0.264711                  0.451
## 96        1    110 141942  141942   0.250722                  0.451
## 97        1    110 141942  141942   0.251381                  0.451
## 98        1    110 141942  141942   0.276349                  0.451
## 99        1    110 141942  141942   0.287737                  0.451
## 100       1    110 141942  141942   0.269276                  0.451
## 101       1    110 141942  141942   0.254299                  0.451
## 102       1    110 141942  141942   0.242370                  0.451
## 103       1    110 141942  141942   0.285702                  0.451
## 104       1    110 141942  141942   0.267452                  0.451
## 105       1    110 141942  141942   0.252852                  0.451
## 106       1    110 141942  141942   0.241173                  0.451
## 107       1    110 141942  141942   0.231541                  0.451
## 108       1    110 141942  141942   0.223420                  0.451
## 109       1    110 141942  141942   0.233463                  0.451
## 110       1    110 141942  141942   0.225632                  0.451
## 111       1    110 141942  141942   0.237427                  0.451
## 112       1    110 141942  141942   0.270955                  0.451
## 113       1    110 141942  141942   0.270955                  0.451
## 114       1    110 141942  141942   0.275541                  0.451
## 115       1    110 141942  141942   0.275541                  0.451
## 116       1    110 141942  141942   0.275541                  0.451
## 117       1    110 141942  141942   0.275541                  0.451
## 118       1    110 141942  141942   0.275541                  0.451
## 119       1    110 141942  141942   0.275541                  0.451
## 120       1    110 141942  141942   0.380992                  0.451
## 121       1    110 141942  141942   0.371347                  0.451
## 122       1    110 141942  141942   0.362845                  0.451
## 123       1    110 141942  141942   0.355672                  0.451
## 124       1    110 141942  141942   0.349731                  0.451
## 125       1    110 141942  141942   0.344304                  0.451
## 126       1    110 141942  141942   0.339717                  0.451
## 127       1    110 141942  141942   0.344679                  0.451
## 128       1    110 141942  141942   0.424426                  0.451
## 129       1    110 141942  141942   0.428482                  0.451
## 130       1    110 141942  141942   0.403963                  0.451
## 131       1    110 141942  141942   0.410938                  0.451
## 132       1    110 141942  141942   0.392850                  0.451
## 133       1    110 141942  141942   0.380018                  0.451
## 134       1    110 141942  141942   0.370119                  0.451
## 135       1    110 141942  141942   0.361875                  0.451
## 136       1    110 141942  141942   0.354879                  0.451
## 137       1    110 141942  141942   0.348935                  0.451
## 138       1    110 141942  141942   0.343638                  0.451
## 139       1    110 141942  141942   0.338840                  0.451
## 140       1    110 141942  141942   0.337243                  0.451
## 141       1    110 141942  141942   0.339443                  0.451
## 142       1    110 141942  141942   0.365117                  0.451
## 143       1    110 141942  141942   0.365928                  0.451
## 144       1    110 141942  141942   0.359435                  0.451
## 145       1    110 141942  141942   0.354304                  0.451
## 146       1    110 141942  141942   0.348468                  0.451
## 147       1    110 141942  141942   0.343282                  0.451
## 148       1    110 141942  141942   0.338610                  0.451
## 149       1    110 141942  141942   0.337243                  0.451
## 150       1    110 141942  141942   0.353017                  0.451
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.152097   0.103656  0.10365649
## 2                  0.152097   0.104249  0.10424910
## 3                  0.152097   0.100974  0.10097439
## 4                  0.152097   0.126444  0.12644416
## 5                  0.152097   0.118760  0.11876048
## 6                  0.152097   0.123487  0.12348696
## 7                  0.152097   0.141464  0.14146427
## 8                  0.152097   0.129672  0.12967152
## 9                  0.152097   0.120924  0.12092438
## 10                 0.152097   0.114234  0.11423379
## 11                 0.152097   0.108883  0.10888267
## 12                 0.152097   0.104469  0.10446919
## 13                 0.152097   0.100746  0.10074618
## 14                 0.152097   0.097550  0.09755040
## 15                 0.152097   0.094769  0.09476863
## 16                 0.152097   0.092320  0.09232015
## 17                 0.152097   0.090145  0.09014498
## 18                 0.152097   0.088197  0.08819711
## 19                 0.152097   0.086441  0.08644046
## 20                 0.152097   0.084847  0.08484708
## 21                 0.152097   0.083394  0.08339441
## 22                 0.152097   0.082064  0.08206396
## 23                 0.152097   0.083037  0.08303722
## 24                 0.152097   0.081960  0.08196023
## 25                 0.152097   0.084430  0.08443036
## 26                 0.152097   0.150017  0.15001748
## 27                 0.152097   0.174327  0.17432683
## 28                 0.152097   0.146419  0.14641850
## 29                 0.152097   0.133111  0.13311039
## 30                 0.152097   0.123899  0.12389917
## 31                 0.152097   0.124605  0.12460454
## 32                 0.152097   0.117447  0.11744671
## 33                 0.152097   0.111443  0.11144255
## 34                 0.152097   0.106556  0.10655552
## 35                 0.152097   0.102472  0.10247216
## 36                 0.152097   0.103151  0.10315137
## 37                 0.152097   0.124487  0.12448682
## 38                 0.152097   0.124882  0.12488190
## 39                 0.152097   0.117590  0.11758968
## 40                 0.152097   0.111549  0.11154854
## 41                 0.152097   0.106633  0.10663264
## 42                 0.152097   0.118274  0.11827340
## 43                 0.152097   0.139807  0.13980684
## 44                 0.152097   0.128482  0.12848268
## 45                 0.152097   0.120008  0.12000794
## 46                 0.152097   0.113467  0.11346754
## 47                 0.152097   0.116021  0.11602110
## 48                 0.152097   0.110486  0.11048643
## 49                 0.152097   0.105743  0.10574236
## 50                 0.152097   0.134275  0.13427488
## 51                 0.152097   0.124486  0.12448637
## 52                 0.152097   0.126052  0.12605225
## 53                 0.152097   0.162795  0.16279521
## 54                 0.152097   0.141652  0.14165234
## 55                 0.152097   0.129885  0.12988529
## 56                 0.152097   0.187324  0.18732420
## 57                 0.152097   0.152097  0.15209659
## 58                 0.152097   0.160041  0.16004096
## 59                 0.152097   0.160104  0.16010365
## 60                 0.152097   0.140327  0.14032730
## 61                 0.152097   0.146832  0.14683162
## 62                 0.152097   0.133415  0.13341527
## 63                 0.152097   0.143871  0.14387126
## 64                 0.152097   0.146044  0.14604417
## 65                 0.152097   0.147427  0.14742694
## 66                 0.152097   0.149600  0.14960031
## 67                 0.152097   0.176118  0.17611821
## 68                 0.152097   0.146975  0.14697459
## 69                 0.152097   0.133573  0.13357267
## 70                 0.152097   0.133756  0.13375578
## 71                 0.152097   0.141855  0.14185528
## 72                 0.152097   0.145016  0.14501634
## 73                 0.152097   0.132318  0.13231844
## 74                 0.152097   0.156137  0.15613710
## 75                 0.152097   0.177790  0.17779051
## 76                 0.152097   0.147482  0.14748196
## 77                 0.152097   0.133938  0.13393753
## 78                 0.152097   0.124696  0.12469609
## 79                 0.152097   0.117830  0.11783006
## 80                 0.152097   0.132829  0.13282942
## 81                 0.152097   0.133817  0.13381711
## 82                 0.152097   0.124619  0.12461942
## 83                 0.152097   0.117780  0.11778000
## 84                 0.152097   0.112433  0.11243295
## 85                 0.152097   0.114789  0.11478942
## 86                 0.152097   0.123779  0.12377875
## 87                 0.152097   0.117136  0.11713597
## 88                 0.152097   0.111919  0.11191881
## 89                 0.152097   0.107687  0.10768707
## 90                 0.152097   0.104173  0.10417288
## 91                 0.152097   0.110875  0.11087519
## 92                 0.152097   0.106821  0.10682070
## 93                 0.152097   0.120042  0.12004222
## 94                 0.152097   0.126957  0.12695650
## 95                 0.152097   0.119385  0.11938466
## 96                 0.152097   0.113076  0.11307562
## 97                 0.152097   0.113373  0.11337283
## 98                 0.152097   0.124633  0.12463340
## 99                 0.152097   0.129770  0.12976939
## 100                0.152097   0.121443  0.12144348
## 101                0.152097   0.114689  0.11468885
## 102                0.152097   0.109309  0.10930887
## 103                0.152097   0.128852  0.12885160
## 104                0.152097   0.120621  0.12062085
## 105                0.152097   0.114036  0.11403625
## 106                0.152097   0.108769  0.10876902
## 107                0.152097   0.104425  0.10442499
## 108                0.152097   0.100762  0.10076242
## 109                0.152097   0.105292  0.10529181
## 110                0.152097   0.101760  0.10176003
## 111                0.152097   0.107079  0.10707958
## 112                0.152097   0.122201  0.12220071
## 113                0.152097   0.122201  0.12220071
## 114                0.152097   0.124269  0.12426899
## 115                0.152097   0.124269  0.12426899
## 116                0.152097   0.124269  0.12426899
## 117                0.152097   0.124269  0.12426899
## 118                0.152097   0.124269  0.12426899
## 119                0.152097   0.124269  0.12426899
## 120                0.152097   0.171828  0.17182739
## 121                0.152097   0.167478  0.16747750
## 122                0.152097   0.163643  0.16364309
## 123                0.152097   0.160408  0.16040807
## 124                0.152097   0.157729  0.15772868
## 125                0.152097   0.155281  0.15528110
## 126                0.152097   0.153212  0.15321237
## 127                0.152097   0.155450  0.15545023
## 128                0.152097   0.191416  0.19141613
## 129                0.152097   0.193245  0.19324538
## 130                0.152097   0.182187  0.18218731
## 131                0.152097   0.185333  0.18533304
## 132                0.152097   0.177176  0.17717535
## 133                0.152097   0.171388  0.17138812
## 134                0.152097   0.166924  0.16692367
## 135                0.152097   0.163206  0.16320562
## 136                0.152097   0.160050  0.16005043
## 137                0.152097   0.157369  0.15736969
## 138                0.152097   0.154981  0.15498074
## 139                0.152097   0.152817  0.15281684
## 140                0.152097   0.152097  0.15209659
## 141                0.152097   0.153089  0.15308879
## 142                0.152097   0.164668  0.16466777
## 143                0.152097   0.165034  0.16503353
## 144                0.152097   0.162105  0.16210519
## 145                0.152097   0.159791  0.15979110
## 146                0.152097   0.157159  0.15715907
## 147                0.152097   0.154820  0.15482018
## 148                0.152097   0.152713  0.15271311
## 149                0.152097   0.152097  0.15209659
## 150                0.152097   0.159211  0.15921067
validationsmNSElistsite2<- c()
validationsmlnNSElistsite2<- c()
validationsmKGElistsite2<- c()


#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site2"))))))
  validationsmKGElistsite2[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


validationsmKGElistsite2
## [[1]]
## [1] 0.4620723
## 
## [[2]]
## [1] -0.05288465
## 
## [[3]]
## [1] 0.1471616
## 
## [[4]]
## [1] 0.0255698
## 
## [[5]]
## [1] -0.4634579
## 
## [[6]]
## [1] -0.4941457

prepare to run model 20 times for patch 3 - only for validation time series

run model in parallel

read 20 runs, create table and append to table

setwd(system.file("extdata/", package = "RHESSysIOinR"))

# Read in RHESSys Validation runs
for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch3_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valstatic3_run",i),temp_dataset)
}


##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valstatic3_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}


validationsmNSElistsite3<- c()
validationsmlnNSElistsite3<- c()
validationsmKGElistsite3<- c()

#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site3"))))))
  validationsmKGElistsite3[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


validationsmKGElistsite3
## [[1]]
## [1] -0.6173167
## 
## [[2]]
## [1] NA
## 
## [[3]]
## [1] -0.1185216
## 
## [[4]]
## [1] -0.08646876
## 
## [[5]]
## [1] -0.601612
## 
## [[6]]
## [1] -0.2381169
valmergesm2
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    110 149478  149478          1               0.193276
## 2         1    110 149478  149478          1               0.193276
## 3         1    110 149478  149478          1               0.193276
## 4         1    110 149478  149478          1               0.193276
## 5         1    110 149478  149478          1               0.193276
## 6         1    110 149478  149478          1               0.193276
## 7         1    110 149478  149478          1               0.193276
## 8         1    110 149478  149478          1               0.193276
## 9         1    110 149478  149478          1               0.193276
## 10        1    110 149478  149478          1               0.193276
## 11        1    110 149478  149478          1               0.193276
## 12        1    110 149478  149478          1               0.193276
## 13        1    110 149478  149478          1               0.193276
## 14        1    110 149478  149478          1               0.193276
## 15        1    110 149478  149478          1               0.193276
## 16        1    110 149478  149478          1               0.193276
## 17        1    110 149478  149478          1               0.193276
## 18        1    110 149478  149478          1               0.193276
## 19        1    110 149478  149478          1               0.193276
## 20        1    110 149478  149478          1               0.193276
## 21        1    110 149478  149478          1               0.193276
## 22        1    110 149478  149478          1               0.193276
## 23        1    110 149478  149478          1               0.193276
## 24        1    110 149478  149478          1               0.193276
## 25        1    110 149478  149478          1               0.193276
## 26        1    110 149478  149478          1               0.193276
## 27        1    110 149478  149478          1               0.193276
## 28        1    110 149478  149478          1               0.193276
## 29        1    110 149478  149478          1               0.193276
## 30        1    110 149478  149478          1               0.193276
## 31        1    110 149478  149478          1               0.193276
## 32        1    110 149478  149478          1               0.193276
## 33        1    110 149478  149478          1               0.193276
## 34        1    110 149478  149478          1               0.193276
## 35        1    110 149478  149478          1               0.193276
## 36        1    110 149478  149478          1               0.193276
## 37        1    110 149478  149478          1               0.193276
## 38        1    110 149478  149478          1               0.193276
## 39        1    110 149478  149478          1               0.193276
## 40        1    110 149478  149478          1               0.193276
## 41        1    110 149478  149478          1               0.193276
## 42        1    110 149478  149478          1               0.193276
## 43        1    110 149478  149478          1               0.193276
## 44        1    110 149478  149478          1               0.193276
## 45        1    110 149478  149478          1               0.193276
## 46        1    110 149478  149478          1               0.193276
## 47        1    110 149478  149478          1               0.193276
## 48        1    110 149478  149478          1               0.193276
## 49        1    110 149478  149478          1               0.193276
## 50        1    110 149478  149478          1               0.193276
## 51        1    110 149478  149478          1               0.193276
## 52        1    110 149478  149478          1               0.193276
## 53        1    110 149478  149478          1               0.193276
## 54        1    110 149478  149478          1               0.193276
## 55        1    110 149478  149478          1               0.193276
## 56        1    110 149478  149478          1               0.193276
## 57        1    110 149478  149478          1               0.193276
## 58        1    110 149478  149478          1               0.193276
## 59        1    110 149478  149478          1               0.193276
## 60        1    110 149478  149478          1               0.193276
## 61        1    110 149478  149478          1               0.193276
## 62        1    110 149478  149478          1               0.193276
## 63        1    110 149478  149478          1               0.193276
## 64        1    110 149478  149478          1               0.193276
## 65        1    110 149478  149478          1               0.193276
## 66        1    110 149478  149478          1               0.193276
## 67        1    110 149478  149478          1               0.193276
## 68        1    110 149478  149478          1               0.193276
## 69        1    110 149478  149478          1               0.193276
## 70        1    110 149478  149478          1               0.193276
## 71        1    110 149478  149478          1               0.193276
## 72        1    110 149478  149478          1               0.193276
## 73        1    110 149478  149478          1               0.193276
## 74        1    110 149478  149478          1               0.193276
## 75        1    110 149478  149478          1               0.193276
## 76        1    110 149478  149478          1               0.193276
## 77        1    110 149478  149478          1               0.193276
## 78        1    110 149478  149478          1               0.193276
## 79        1    110 149478  149478          1               0.193276
## 80        1    110 149478  149478          1               0.193276
## 81        1    110 149478  149478          1               0.193276
## 82        1    110 149478  149478          1               0.193276
## 83        1    110 149478  149478          1               0.193276
## 84        1    110 149478  149478          1               0.193276
## 85        1    110 149478  149478          1               0.193276
## 86        1    110 149478  149478          1               0.193276
## 87        1    110 149478  149478          1               0.193276
## 88        1    110 149478  149478          1               0.193276
## 89        1    110 149478  149478          1               0.193276
## 90        1    110 149478  149478          1               0.193276
## 91        1    110 149478  149478          1               0.193276
## 92        1    110 149478  149478          1               0.193276
## 93        1    110 149478  149478          1               0.193276
## 94        1    110 149478  149478          1               0.193276
## 95        1    110 149478  149478          1               0.193276
## 96        1    110 149478  149478          1               0.193276
## 97        1    110 149478  149478          1               0.193276
## 98        1    110 149478  149478          1               0.193276
## 99        1    110 149478  149478          1               0.193276
## 100       1    110 149478  149478          1               0.193276
## 101       1    110 149478  149478          1               0.193276
## 102       1    110 149478  149478          1               0.193276
## 103       1    110 149478  149478          1               0.193276
## 104       1    110 149478  149478          1               0.193276
## 105       1    110 149478  149478          1               0.193276
## 106       1    110 149478  149478          1               0.193276
## 107       1    110 149478  149478          1               0.193276
## 108       1    110 149478  149478          1               0.193276
## 109       1    110 149478  149478          1               0.193276
## 110       1    110 149478  149478          1               0.193276
## 111       1    110 149478  149478          1               0.193276
## 112       1    110 149478  149478          1               0.193276
## 113       1    110 149478  149478          1               0.193276
## 114       1    110 149478  149478          1               0.193276
## 115       1    110 149478  149478          1               0.193276
## 116       1    110 149478  149478          1               0.193276
## 117       1    110 149478  149478          1               0.193276
## 118       1    110 149478  149478          1               0.193276
## 119       1    110 149478  149478          1               0.193276
## 120       1    110 149478  149478          1               0.193276
## 121       1    110 149478  149478          1               0.193276
## 122       1    110 149478  149478          1               0.193276
## 123       1    110 149478  149478          1               0.193276
## 124       1    110 149478  149478          1               0.193276
## 125       1    110 149478  149478          1               0.193276
## 126       1    110 149478  149478          1               0.193276
## 127       1    110 149478  149478          1               0.193276
## 128       1    110 149478  149478          1               0.193276
## 129       1    110 149478  149478          1               0.193276
## 130       1    110 149478  149478          1               0.193276
## 131       1    110 149478  149478          1               0.193276
## 132       1    110 149478  149478          1               0.193276
## 133       1    110 149478  149478          1               0.193276
## 134       1    110 149478  149478          1               0.193276
## 135       1    110 149478  149478          1               0.193276
## 136       1    110 149478  149478          1               0.193276
## 137       1    110 149478  149478          1               0.193276
## 138       1    110 149478  149478          1               0.193276
## 139       1    110 149478  149478          1               0.193276
## 140       1    110 149478  149478          1               0.193276
## 141       1    110 149478  149478          1               0.193276
## 142       1    110 149478  149478          1               0.193276
## 143       1    110 149478  149478          1               0.193276
## 144       1    110 149478  149478          1               0.193276
## 145       1    110 149478  149478          1               0.193276
## 146       1    110 149478  149478          1               0.193276
## 147       1    110 149478  149478          1               0.193276
## 148       1    110 149478  149478          1               0.193276
## 149       1    110 149478  149478          1               0.193276
## 150       1    110 149478  149478          1               0.193276
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                         0          0    0.193276
## 2                         0          0    0.193276
## 3                         0          0    0.193276
## 4                         0          0    0.193276
## 5                         0          0    0.193276
## 6                         0          0    0.193276
## 7                         0          0    0.193276
## 8                         0          0    0.193276
## 9                         0          0    0.193276
## 10                        0          0    0.193276
## 11                        0          0    0.193276
## 12                        0          0    0.193276
## 13                        0          0    0.193276
## 14                        0          0    0.193276
## 15                        0          0    0.193276
## 16                        0          0    0.193276
## 17                        0          0    0.193276
## 18                        0          0    0.193276
## 19                        0          0    0.193276
## 20                        0          0    0.193276
## 21                        0          0    0.193276
## 22                        0          0    0.193276
## 23                        0          0    0.193276
## 24                        0          0    0.193276
## 25                        0          0    0.193276
## 26                        0          0    0.193276
## 27                        0          0    0.193276
## 28                        0          0    0.193276
## 29                        0          0    0.193276
## 30                        0          0    0.193276
## 31                        0          0    0.193276
## 32                        0          0    0.193276
## 33                        0          0    0.193276
## 34                        0          0    0.193276
## 35                        0          0    0.193276
## 36                        0          0    0.193276
## 37                        0          0    0.193276
## 38                        0          0    0.193276
## 39                        0          0    0.193276
## 40                        0          0    0.193276
## 41                        0          0    0.193276
## 42                        0          0    0.193276
## 43                        0          0    0.193276
## 44                        0          0    0.193276
## 45                        0          0    0.193276
## 46                        0          0    0.193276
## 47                        0          0    0.193276
## 48                        0          0    0.193276
## 49                        0          0    0.193276
## 50                        0          0    0.193276
## 51                        0          0    0.193276
## 52                        0          0    0.193276
## 53                        0          0    0.193276
## 54                        0          0    0.193276
## 55                        0          0    0.193276
## 56                        0          0    0.193276
## 57                        0          0    0.193276
## 58                        0          0    0.193276
## 59                        0          0    0.193276
## 60                        0          0    0.193276
## 61                        0          0    0.193276
## 62                        0          0    0.193276
## 63                        0          0    0.193276
## 64                        0          0    0.193276
## 65                        0          0    0.193276
## 66                        0          0    0.193276
## 67                        0          0    0.193276
## 68                        0          0    0.193276
## 69                        0          0    0.193276
## 70                        0          0    0.193276
## 71                        0          0    0.193276
## 72                        0          0    0.193276
## 73                        0          0    0.193276
## 74                        0          0    0.193276
## 75                        0          0    0.193276
## 76                        0          0    0.193276
## 77                        0          0    0.193276
## 78                        0          0    0.193276
## 79                        0          0    0.193276
## 80                        0          0    0.193276
## 81                        0          0    0.193276
## 82                        0          0    0.193276
## 83                        0          0    0.193276
## 84                        0          0    0.193276
## 85                        0          0    0.193276
## 86                        0          0    0.193276
## 87                        0          0    0.193276
## 88                        0          0    0.193276
## 89                        0          0    0.193276
## 90                        0          0    0.193276
## 91                        0          0    0.193276
## 92                        0          0    0.193276
## 93                        0          0    0.193276
## 94                        0          0    0.193276
## 95                        0          0    0.193276
## 96                        0          0    0.193276
## 97                        0          0    0.193276
## 98                        0          0    0.193276
## 99                        0          0    0.193276
## 100                       0          0    0.193276
## 101                       0          0    0.193276
## 102                       0          0    0.193276
## 103                       0          0    0.193276
## 104                       0          0    0.193276
## 105                       0          0    0.193276
## 106                       0          0    0.193276
## 107                       0          0    0.193276
## 108                       0          0    0.193276
## 109                       0          0    0.193276
## 110                       0          0    0.193276
## 111                       0          0    0.193276
## 112                       0          0    0.193276
## 113                       0          0    0.193276
## 114                       0          0    0.193276
## 115                       0          0    0.193276
## 116                       0          0    0.193276
## 117                       0          0    0.193276
## 118                       0          0    0.193276
## 119                       0          0    0.193276
## 120                       0          0    0.193276
## 121                       0          0    0.193276
## 122                       0          0    0.193276
## 123                       0          0    0.193276
## 124                       0          0    0.193276
## 125                       0          0    0.193276
## 126                       0          0    0.193276
## 127                       0          0    0.193276
## 128                       0          0    0.193276
## 129                       0          0    0.193276
## 130                       0          0    0.193276
## 131                       0          0    0.193276
## 132                       0          0    0.193276
## 133                       0          0    0.193276
## 134                       0          0    0.193276
## 135                       0          0    0.193276
## 136                       0          0    0.193276
## 137                       0          0    0.193276
## 138                       0          0    0.193276
## 139                       0          0    0.193276
## 140                       0          0    0.193276
## 141                       0          0    0.193276
## 142                       0          0    0.193276
## 143                       0          0    0.193276
## 144                       0          0    0.193276
## 145                       0          0    0.193276
## 146                       0          0    0.193276
## 147                       0          0    0.193276
## 148                       0          0    0.193276
## 149                       0          0    0.193276
## 150                       0          0    0.193276

merge all 3 sites

setwd(system.file("extdata/", package = "RHESSysIOinR"))

threesitevalidation1<- data.frame(cbind(site1=as.numeric(validationsmKGElistsite1),site2=as.numeric(validationsmKGElistsite2),site3=as.numeric(validationsmKGElistsite3)))


threesitevalidation<-threesitevalidation1

threesitevalidation$allsites<- rowMeans(threesitevalidation1,na.rm=FALSE)

threesitevalidation
##         site1       site2       site3    allsites
## 1  0.46001284  0.46207232 -0.61731666  0.10158950
## 2 -0.18687184 -0.05288465          NA          NA
## 3  0.14011585  0.14716157 -0.11852162  0.05625193
## 4  0.01728628  0.02556980 -0.08646876 -0.01453756
## 5 -0.71484497 -0.46345791 -0.60161200 -0.59330496
## 6 -0.71869821 -0.49414566 -0.23811692 -0.48365360
boxplot(threesitevalidation1, main = "Boxplot of Patch Specific Soil Moisture KGE - Static")

boxplot(threesitevalidation, main = "Boxplot of Patch Specific Soil Moisture KGE - Static")

plot(validationsmKGElistsite1,validationsmKGElistsite3)

write.csv(threesitevalidation,'threesitevalidationstatic.csv')

SSURGO

run model 20 times for patch 1 - only for validation time series

input_rhessys = IOin_rhessys_input(
  version = rh_path,
  tec_file = "tecfiles/tec_daily",
  world_file = "CWWS32ssurgo.world.Y2018M11D1H1.state.Y2018M11D1H1.state",
  world_hdr_prefix = "CWWS32ssurgo",
  flowtable = "CWWS32ssurgo.flow",
  start = "2015 11 1 1",
  end = "2018 11 1 1",
  output_folder = "out",
  output_prefix = "cwws32valssurgo",
commandline_options = c(""))

input_tec_data = IOin_tec_std(start = "2017 11 1 1",
                              end = "2018 11 1 1",
                              output_state = FALSE)

input_hdr = IOin_hdr(
  basin = "defs/basin.def",
  hillslope = "defs/hillslope.def",
  zone = "defs/zone.def",
  soil = c("defs/soil_clay.def","defs/soil_clayloam.def","defs/soil_loam.def","defs/soil_loamysand.def","defs/soil_rock.def","defs/soil_sand.def","defs/soil_sandyclay.def","defs/soil_sandyclayloam.def","defs/soil_sandyloam.def","defs/soil_silt.def","defs/soil_siltyclay.def","defs/soil_siltyclayloam.def","defs/soil_siltyloam.def","defs/soil_water.def", "defs/soil_shallowloam.def", "defs/soil_shallowsandyclayloam.def", "defs/soil_shallowsandyloam.def"),
  landuse = "defs/lu_undev.def",
  stratum = c("defs/veg_deciduous/veg_deciduous.def","defs/veg_evergreen/veg_evergreen.def","defs/veg_deciduous_BES.def","defs/veg_eucalypt.def","defs/veg_grass.def","defs/veg_lawn_2cm.def","defs/veg_lawn_5cm.def","defs/veg_lawn_10cm.def","defs/veg_nonveg.def"),
  basestations = "clim/cwtws32local.base")

run SSURGO

n.cores <- parallel::detectCores() - 4  
  
my.cluster <- parallel::makeCluster(
    n.cores, 
    type = "PSOCK"
  )
doParallel::registerDoParallel(cl = my.cluster)

start_time = Sys.time()
  
  foreach(i = 1:validationruns, .packages = 'RHESSysIOinR') %dopar% {
    
    stdpars<- IOin_cmd_pars(m = topssurgo[i,]$m,
                            k = topssurgo[i,]$k,
                            soil_dep= topssurgo[i,]$soil_dep,
                            m_v = topssurgo[i,]$m_v,
                            k_v = topssurgo[i,]$k_v,
                            gw1 = topssurgo[i,]$gw1,
                            gw2 = topssurgo[i,]$gw2,
                            pa = topssurgo[i,]$pa,
                            po = topssurgo[i,]$po,
                            vgseng1 = topssurgo[i,]$vgseng1,
                            vgseng2 = topssurgo[i,]$vgseng2,
                            vgseng3 = topssurgo[i,]$vgseng3)
    
    run_rhessys_single(input_rhessys = input_rhessys,
                       hdr_files = input_hdr,
                       tec_data = input_tec_data,
                       cmd_pars = stdpars,
                       output_filter = c(patchfilterpatch1,patchfilterpatch2,patchfilterpatch3),
                       runID = i)
  } 
## [[1]]
## NULL
## 
## [[2]]
## NULL
## 
## [[3]]
## NULL
## 
## [[4]]
## NULL
## 
## [[5]]
## NULL
## 
## [[6]]
## NULL
  end_time = Sys.time()
  end_time - start_time
## Time difference of 3.285948 mins

read 20 runs, create table and append to table for site 1

setwd(system.file("extdata/", package = "RHESSysIOinR"))

getwd()
## [1] "C:/Users/Carlos/Documents/R/win-library/4.0/RHESSysIOinR/extdata"
# Read in RHESSys Validation runs
for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch1_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valssurgo_run",i),temp_dataset)
}


##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valssurgo_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}

valmergesm1
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    112 136557  136557   0.292923                 0.0454
## 2         1    112 136557  136557   0.295303                 0.0454
## 3         1    112 136557  136557   0.143380                 0.0454
## 4         1    112 136557  136557   0.259786                 0.0454
## 5         1    112 136557  136557   0.166394                 0.0454
## 6         1    112 136557  136557   0.268341                 0.0454
## 7         1    112 136557  136557   0.259786                 0.0454
## 8         1    112 136557  136557   0.166456                 0.0454
## 9         1    112 136557  136557   0.147950                 0.0454
## 10        1    112 136557  136557   0.136177                 0.0454
## 11        1    112 136557  136557   0.127720                 0.0454
## 12        1    112 136557  136557   0.121240                 0.0454
## 13        1    112 136557  136557   0.121240                 0.0454
## 14        1    112 136557  136557   0.121240                 0.0454
## 15        1    112 136557  136557   0.121240                 0.0454
## 16        1    112 136557  136557   0.121240                 0.0454
## 17        1    112 136557  136557   0.121240                 0.0454
## 18        1    112 136557  136557   0.121240                 0.0454
## 19        1    112 136557  136557   0.121240                 0.0454
## 20        1    112 136557  136557   0.121240                 0.0454
## 21        1    112 136557  136557   0.121240                 0.0454
## 22        1    112 136557  136557   0.121240                 0.0454
## 23        1    112 136557  136557   0.142897                 0.0454
## 24        1    112 136557  136557   0.132587                 0.0454
## 25        1    112 136557  136557   0.189133                 0.0454
## 26        1    112 136557  136557   0.259786                 0.0454
## 27        1    112 136557  136557   0.259786                 0.0454
## 28        1    112 136557  136557   0.166793                 0.0454
## 29        1    112 136557  136557   0.148130                 0.0454
## 30        1    112 136557  136557   0.136261                 0.0454
## 31        1    112 136557  136557   0.148623                 0.0454
## 32        1    112 136557  136557   0.136603                 0.0454
## 33        1    112 136557  136557   0.127996                 0.0454
## 34        1    112 136557  136557   0.121413                 0.0454
## 35        1    112 136557  136557   0.121413                 0.0454
## 36        1    112 136557  136557   0.121413                 0.0454
## 37        1    112 136557  136557   0.259786                 0.0454
## 38        1    112 136557  136557   0.266274                 0.0454
## 39        1    112 136557  136557   0.162748                 0.0454
## 40        1    112 136557  136557   0.145736                 0.0454
## 41        1    112 136557  136557   0.134606                 0.0454
## 42        1    112 136557  136557   0.327129                 0.0454
## 43        1    112 136557  136557   0.259786                 0.0454
## 44        1    112 136557  136557   0.166690                 0.0454
## 45        1    112 136557  136557   0.148075                 0.0454
## 46        1    112 136557  136557   0.136234                 0.0454
## 47        1    112 136557  136557   0.192703                 0.0454
## 48        1    112 136557  136557   0.160876                 0.0454
## 49        1    112 136557  136557   0.144595                 0.0454
## 50        1    112 136557  136557   0.259786                 0.0454
## 51        1    112 136557  136557   0.166652                 0.0454
## 52        1    112 136557  136557   0.201364                 0.0454
## 53        1    112 136557  136557   0.259786                 0.0454
## 54        1    112 136557  136557   0.166611                 0.0454
## 55        1    112 136557  136557   0.148034                 0.0454
## 56        1    112 136557  136557   0.259786                 0.0454
## 57        1    112 136557  136557   0.259786                 0.0454
## 58        1    112 136557  136557   0.259786                 0.0454
## 59        1    112 136557  136557   0.306697                 0.0454
## 60        1    112 136557  136557   0.130782                 0.0454
## 61        1    112 136557  136557   0.271594                 0.0454
## 62        1    112 136557  136557   0.158868                 0.0454
## 63        1    112 136557  136557   0.327926                 0.0454
## 64        1    112 136557  136557   0.330366                 0.0454
## 65        1    112 136557  136557   0.325809                 0.0454
## 66        1    112 136557  136557   0.330089                 0.0454
## 67        1    112 136557  136557   0.259786                 0.0454
## 68        1    112 136557  136557   0.165218                 0.0454
## 69        1    112 136557  136557   0.147441                 0.0454
## 70        1    112 136557  136557   0.151693                 0.0454
## 71        1    112 136557  136557   0.315974                 0.0454
## 72        1    112 136557  136557   0.330864                 0.0454
## 73        1    112 136557  136557   0.095212                 0.0454
## 74        1    112 136557  136557   0.259786                 0.0454
## 75        1    112 136557  136557   0.259786                 0.0454
## 76        1    112 136557  136557   0.165073                 0.0454
## 77        1    112 136557  136557   0.147393                 0.0454
## 78        1    112 136557  136557   0.136195                 0.0454
## 79        1    112 136557  136557   0.128213                 0.0454
## 80        1    112 136557  136557   0.259786                 0.0454
## 81        1    112 136557  136557   0.278129                 0.0454
## 82        1    112 136557  136557   0.154427                 0.0454
## 83        1    112 136557  136557   0.140862                 0.0454
## 84        1    112 136557  136557   0.131598                 0.0454
## 85        1    112 136557  136557   0.183715                 0.0454
## 86        1    112 136557  136557   0.329740                 0.0454
## 87        1    112 136557  136557   0.302740                 0.0454
## 88        1    112 136557  136557   0.287090                 0.0454
## 89        1    112 136557  136557   0.269889                 0.0454
## 90        1    112 136557  136557   0.259786                 0.0454
## 91        1    112 136557  136557   0.315208                 0.0454
## 92        1    112 136557  136557   0.290739                 0.0454
## 93        1    112 136557  136557   0.259786                 0.0454
## 94        1    112 136557  136557   0.310242                 0.0454
## 95        1    112 136557  136557   0.303340                 0.0454
## 96        1    112 136557  136557   0.285322                 0.0454
## 97        1    112 136557  136557   0.269920                 0.0454
## 98        1    112 136557  136557   0.259786                 0.0454
## 99        1    112 136557  136557   0.331067                 0.0454
## 100       1    112 136557  136557   0.303834                 0.0454
## 101       1    112 136557  136557   0.285930                 0.0454
## 102       1    112 136557  136557   0.269469                 0.0454
## 103       1    112 136557  136557   0.259786                 0.0454
## 104       1    112 136557  136557   0.251576                 0.0454
## 105       1    112 136557  136557   0.242482                 0.0454
## 106       1    112 136557  136557   0.232202                 0.0454
## 107       1    112 136557  136557   0.222297                 0.0454
## 108       1    112 136557  136557   0.214725                 0.0454
## 109       1    112 136557  136557   0.305482                 0.0454
## 110       1    112 136557  136557   0.282715                 0.0454
## 111       1    112 136557  136557   0.324066                 0.0454
## 112       1    112 136557  136557   0.259786                 0.0454
## 113       1    112 136557  136557   0.252431                 0.0454
## 114       1    112 136557  136557   0.294150                 0.0454
## 115       1    112 136557  136557   0.276877                 0.0454
## 116       1    112 136557  136557   0.261387                 0.0454
## 117       1    112 136557  136557   0.249199                 0.0454
## 118       1    112 136557  136557   0.240461                 0.0454
## 119       1    112 136557  136557   0.234087                 0.0454
## 120       1    112 136557  136557   0.259786                 0.0454
## 121       1    112 136557  136557   0.257491                 0.0454
## 122       1    112 136557  136557   0.243240                 0.0454
## 123       1    112 136557  136557   0.228571                 0.0454
## 124       1    112 136557  136557   0.218455                 0.0454
## 125       1    112 136557  136557   0.205091                 0.0454
## 126       1    112 136557  136557   0.196255                 0.0454
## 127       1    112 136557  136557   0.283423                 0.0454
## 128       1    112 136557  136557   0.259786                 0.0454
## 129       1    112 136557  136557   0.259786                 0.0454
## 130       1    112 136557  136557   0.253830                 0.0454
## 131       1    112 136557  136557   0.259786                 0.0454
## 132       1    112 136557  136557   0.249602                 0.0454
## 133       1    112 136557  136557   0.238959                 0.0454
## 134       1    112 136557  136557   0.228870                 0.0454
## 135       1    112 136557  136557   0.215790                 0.0454
## 136       1    112 136557  136557   0.202045                 0.0454
## 137       1    112 136557  136557   0.190347                 0.0454
## 138       1    112 136557  136557   0.177810                 0.0454
## 139       1    112 136557  136557   0.164356                 0.0454
## 140       1    112 136557  136557   0.157909                 0.0454
## 141       1    112 136557  136557   0.201255                 0.0454
## 142       1    112 136557  136557   0.259786                 0.0454
## 143       1    112 136557  136557   0.322794                 0.0454
## 144       1    112 136557  136557   0.307310                 0.0454
## 145       1    112 136557  136557   0.301399                 0.0454
## 146       1    112 136557  136557   0.278798                 0.0454
## 147       1    112 136557  136557   0.260063                 0.0454
## 148       1    112 136557  136557   0.247165                 0.0454
## 149       1    112 136557  136557   0.234846                 0.0454
## 150       1    112 136557  136557   0.296677                 0.0454
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.011794   0.013299 0.013298704
## 2                  0.011794   0.013407 0.013406756
## 3                  0.011794   0.006509 0.006509452
## 4                  0.011794   0.011794 0.011794284
## 5                  0.011794   0.007554 0.007554288
## 6                  0.011794   0.012183 0.012182681
## 7                  0.011794   0.011794 0.011794284
## 8                  0.011794   0.007557 0.007557102
## 9                  0.011794   0.006717 0.006716930
## 10                 0.011794   0.006182 0.006182436
## 11                 0.011794   0.005798 0.005798488
## 12                 0.011794   0.005504 0.005504296
## 13                 0.011794   0.005504 0.005504296
## 14                 0.011794   0.005504 0.005504296
## 15                 0.011794   0.005504 0.005504296
## 16                 0.011794   0.005504 0.005504296
## 17                 0.011794   0.005504 0.005504296
## 18                 0.011794   0.005504 0.005504296
## 19                 0.011794   0.005504 0.005504296
## 20                 0.011794   0.005504 0.005504296
## 21                 0.011794   0.005504 0.005504296
## 22                 0.011794   0.005504 0.005504296
## 23                 0.011794   0.006488 0.006487524
## 24                 0.011794   0.006019 0.006019450
## 25                 0.011794   0.008587 0.008586638
## 26                 0.011794   0.011794 0.011794284
## 27                 0.011794   0.011794 0.011794284
## 28                 0.011794   0.007572 0.007572402
## 29                 0.011794   0.006725 0.006725102
## 30                 0.011794   0.006186 0.006186249
## 31                 0.011794   0.006747 0.006747484
## 32                 0.011794   0.006202 0.006201776
## 33                 0.011794   0.005811 0.005811018
## 34                 0.011794   0.005512 0.005512150
## 35                 0.011794   0.005512 0.005512150
## 36                 0.011794   0.005512 0.005512150
## 37                 0.011794   0.011794 0.011794284
## 38                 0.011794   0.012089 0.012088840
## 39                 0.011794   0.007389 0.007388759
## 40                 0.011794   0.006616 0.006616414
## 41                 0.011794   0.006111 0.006111112
## 42                 0.011794   0.014852 0.014851657
## 43                 0.011794   0.011794 0.011794284
## 44                 0.011794   0.007568 0.007567726
## 45                 0.011794   0.006723 0.006722605
## 46                 0.011794   0.006185 0.006185024
## 47                 0.011794   0.008749 0.008748716
## 48                 0.011794   0.007304 0.007303770
## 49                 0.011794   0.006565 0.006564613
## 50                 0.011794   0.011794 0.011794284
## 51                 0.011794   0.007566 0.007566001
## 52                 0.011794   0.009142 0.009141926
## 53                 0.011794   0.011794 0.011794284
## 54                 0.011794   0.007564 0.007564139
## 55                 0.011794   0.006721 0.006720744
## 56                 0.011794   0.011794 0.011794284
## 57                 0.011794   0.011794 0.011794284
## 58                 0.011794   0.011794 0.011794284
## 59                 0.011794   0.013924 0.013924044
## 60                 0.011794   0.005938 0.005937503
## 61                 0.011794   0.012330 0.012330368
## 62                 0.011794   0.007213 0.007212607
## 63                 0.011794   0.014888 0.014887840
## 64                 0.011794   0.014999 0.014998616
## 65                 0.011794   0.014792 0.014791729
## 66                 0.011794   0.014986 0.014986041
## 67                 0.011794   0.011794 0.011794284
## 68                 0.011794   0.007501 0.007500897
## 69                 0.011794   0.006694 0.006693821
## 70                 0.011794   0.006887 0.006886862
## 71                 0.011794   0.014345 0.014345220
## 72                 0.011794   0.015021 0.015021226
## 73                 0.011794   0.004323 0.004322625
## 74                 0.011794   0.011794 0.011794284
## 75                 0.011794   0.011794 0.011794284
## 76                 0.011794   0.007494 0.007494314
## 77                 0.011794   0.006692 0.006691642
## 78                 0.011794   0.006183 0.006183253
## 79                 0.011794   0.005821 0.005820870
## 80                 0.011794   0.011794 0.011794284
## 81                 0.011794   0.012627 0.012627057
## 82                 0.011794   0.007011 0.007010986
## 83                 0.011794   0.006395 0.006395135
## 84                 0.011794   0.005975 0.005974549
## 85                 0.011794   0.008341 0.008340661
## 86                 0.011794   0.014970 0.014970196
## 87                 0.011794   0.013744 0.013744396
## 88                 0.011794   0.013034 0.013033886
## 89                 0.011794   0.012253 0.012252961
## 90                 0.011794   0.011794 0.011794284
## 91                 0.011794   0.014310 0.014310443
## 92                 0.011794   0.013200 0.013199551
## 93                 0.011794   0.011794 0.011794284
## 94                 0.011794   0.014085 0.014084987
## 95                 0.011794   0.013772 0.013771636
## 96                 0.011794   0.012954 0.012953619
## 97                 0.011794   0.012254 0.012254368
## 98                 0.011794   0.011794 0.011794284
## 99                 0.011794   0.015030 0.015030442
## 100                0.011794   0.013794 0.013794064
## 101                0.011794   0.012981 0.012981222
## 102                0.011794   0.012234 0.012233893
## 103                0.011794   0.011794 0.011794284
## 104                0.011794   0.011422 0.011421550
## 105                0.011794   0.011009 0.011008683
## 106                0.011794   0.010542 0.010541971
## 107                0.011794   0.010092 0.010092284
## 108                0.011794   0.009748 0.009748515
## 109                0.011794   0.013869 0.013868883
## 110                0.011794   0.012835 0.012835261
## 111                0.011794   0.014713 0.014712596
## 112                0.011794   0.011794 0.011794284
## 113                0.011794   0.011460 0.011460367
## 114                0.011794   0.013354 0.013354410
## 115                0.011794   0.012570 0.012570216
## 116                0.011794   0.011867 0.011866970
## 117                0.011794   0.011314 0.011313635
## 118                0.011794   0.010917 0.010916929
## 119                0.011794   0.010628 0.010627550
## 120                0.011794   0.011794 0.011794284
## 121                0.011794   0.011690 0.011690091
## 122                0.011794   0.011043 0.011043096
## 123                0.011794   0.010377 0.010377123
## 124                0.011794   0.009918 0.009917857
## 125                0.011794   0.009311 0.009311131
## 126                0.011794   0.008910 0.008909977
## 127                0.011794   0.012867 0.012867404
## 128                0.011794   0.011794 0.011794284
## 129                0.011794   0.011794 0.011794284
## 130                0.011794   0.011524 0.011523882
## 131                0.011794   0.011794 0.011794284
## 132                0.011794   0.011332 0.011331931
## 133                0.011794   0.010849 0.010848739
## 134                0.011794   0.010391 0.010390698
## 135                0.011794   0.009797 0.009796866
## 136                0.011794   0.009173 0.009172843
## 137                0.011794   0.008642 0.008641754
## 138                0.011794   0.008073 0.008072574
## 139                0.011794   0.007462 0.007461762
## 140                0.011794   0.007169 0.007169069
## 141                0.011794   0.009137 0.009136977
## 142                0.011794   0.011794 0.011794284
## 143                0.011794   0.014655 0.014654848
## 144                0.011794   0.013952 0.013951874
## 145                0.011794   0.013684 0.013683515
## 146                0.011794   0.012657 0.012657429
## 147                0.011794   0.011807 0.011806860
## 148                0.011794   0.011221 0.011221291
## 149                0.011794   0.010662 0.010662008
## 150                0.011794   0.013469 0.013469136
validationsmNSElistsite1<- c()
validationsmlnNSElistsite1<- c()
validationsmKGElistsite1<- c()


#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site1"))))))
  validationsmKGElistsite1[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


validationsmKGElistsite1
## [[1]]
## [1] -0.4129805
## 
## [[2]]
## [1] -0.3331869
## 
## [[3]]
## [1] -0.3865526
## 
## [[4]]
## [1] -0.2519766
## 
## [[5]]
## [1] -0.2582159
## 
## [[6]]
## [1] -0.3966292

prepare to run model n times for patch 2 - only for validation time series

run model in parallel

read 20 runs, create table and append to table for site 2

setwd(system.file("extdata/", package = "RHESSysIOinR"))

# Read in RHESSys Validation runs
for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch2_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valssurgo2_run",i),temp_dataset)
}


##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valssurgo2_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}


valmergesm1
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    110 141942  141942   0.239825                  0.435
## 2         1    110 141942  141942   0.241187                  0.435
## 3         1    110 141942  141942   0.233802                  0.435
## 4         1    110 141942  141942   0.291852                  0.435
## 5         1    110 141942  141942   0.276466                  0.435
## 6         1    110 141942  141942   0.286620                  0.435
## 7         1    110 141942  141942   0.326158                  0.435
## 8         1    110 141942  141942   0.302645                  0.435
## 9         1    110 141942  141942   0.285018                  0.435
## 10        1    110 141942  141942   0.270957                  0.435
## 11        1    110 141942  141942   0.259579                  0.435
## 12        1    110 141942  141942   0.250012                  0.435
## 13        1    110 141942  141942   0.241641                  0.435
## 14        1    110 141942  141942   0.234224                  0.435
## 15        1    110 141942  141942   0.227587                  0.435
## 16        1    110 141942  141942   0.221597                  0.435
## 17        1    110 141942  141942   0.216152                  0.435
## 18        1    110 141942  141942   0.211172                  0.435
## 19        1    110 141942  141942   0.206590                  0.435
## 20        1    110 141942  141942   0.202356                  0.435
## 21        1    110 141942  141942   0.198426                  0.435
## 22        1    110 141942  141942   0.194764                  0.435
## 23        1    110 141942  141942   0.197001                  0.435
## 24        1    110 141942  141942   0.193434                  0.435
## 25        1    110 141942  141942   0.199111                  0.435
## 26        1    110 141942  141942   0.347367                  0.435
## 27        1    110 141942  141942   0.398211                  0.435
## 28        1    110 141942  141942   0.345498                  0.435
## 29        1    110 141942  141942   0.316132                  0.435
## 30        1    110 141942  141942   0.295415                  0.435
## 31        1    110 141942  141942   0.295946                  0.435
## 32        1    110 141942  141942   0.279843                  0.435
## 33        1    110 141942  141942   0.266785                  0.435
## 34        1    110 141942  141942   0.256086                  0.435
## 35        1    110 141942  141942   0.247013                  0.435
## 36        1    110 141942  141942   0.248571                  0.435
## 37        1    110 141942  141942   0.297032                  0.435
## 38        1    110 141942  141942   0.296809                  0.435
## 39        1    110 141942  141942   0.280552                  0.435
## 40        1    110 141942  141942   0.267389                  0.435
## 41        1    110 141942  141942   0.256616                  0.435
## 42        1    110 141942  141942   0.282999                  0.435
## 43        1    110 141942  141942   0.330568                  0.435
## 44        1    110 141942  141942   0.305987                  0.435
## 45        1    110 141942  141942   0.287760                  0.435
## 46        1    110 141942  141942   0.273308                  0.435
## 47        1    110 141942  141942   0.278591                  0.435
## 48        1    110 141942  141942   0.265787                  0.435
## 49        1    110 141942  141942   0.255262                  0.435
## 50        1    110 141942  141942   0.319696                  0.435
## 51        1    110 141942  141942   0.298148                  0.435
## 52        1    110 141942  141942   0.300527                  0.435
## 53        1    110 141942  141942   0.381639                  0.435
## 54        1    110 141942  141942   0.337742                  0.435
## 55        1    110 141942  141942   0.311041                  0.435
## 56        1    110 141942  141942   0.430181                  0.435
## 57        1    110 141942  141942   0.259786                  0.435
## 58        1    110 141942  141942   0.280780                  0.435
## 59        1    110 141942  141942   0.285938                  0.435
## 60        1    110 141942  141942   0.271806                  0.435
## 61        1    110 141942  141942   0.286094                  0.435
## 62        1    110 141942  141942   0.271903                  0.435
## 63        1    110 141942  141942   0.295136                  0.435
## 64        1    110 141942  141942   0.298991                  0.435
## 65        1    110 141942  141942   0.300927                  0.435
## 66        1    110 141942  141942   0.304568                  0.435
## 67        1    110 141942  141942   0.368444                  0.435
## 68        1    110 141942  141942   0.330193                  0.435
## 69        1    110 141942  141942   0.305538                  0.435
## 70        1    110 141942  141942   0.304515                  0.435
## 71        1    110 141942  141942   0.321241                  0.435
## 72        1    110 141942  141942   0.326018                  0.435
## 73        1    110 141942  141942   0.302523                  0.435
## 74        1    110 141942  141942   0.355885                  0.435
## 75        1    110 141942  141942   0.402597                  0.435
## 76        1    110 141942  141942   0.347057                  0.435
## 77        1    110 141942  141942   0.316945                  0.435
## 78        1    110 141942  141942   0.295854                  0.435
## 79        1    110 141942  141942   0.279627                  0.435
## 80        1    110 141942  141942   0.312843                  0.435
## 81        1    110 141942  141942   0.313284                  0.435
## 82        1    110 141942  141942   0.293098                  0.435
## 83        1    110 141942  141942   0.277420                  0.435
## 84        1    110 141942  141942   0.264646                  0.435
## 85        1    110 141942  141942   0.269624                  0.435
## 86        1    110 141942  141942   0.289592                  0.435
## 87        1    110 141942  141942   0.274601                  0.435
## 88        1    110 141942  141942   0.262298                  0.435
## 89        1    110 141942  141942   0.252147                  0.435
## 90        1    110 141942  141942   0.243480                  0.435
## 91        1    110 141942  141942   0.258886                  0.435
## 92        1    110 141942  141942   0.249369                  0.435
## 93        1    110 141942  141942   0.279426                  0.435
## 94        1    110 141942  141942   0.294462                  0.435
## 95        1    110 141942  141942   0.278506                  0.435
## 96        1    110 141942  141942   0.265547                  0.435
## 97        1    110 141942  141942   0.265814                  0.435
## 98        1    110 141942  141942   0.291011                  0.435
## 99        1    110 141942  141942   0.301686                  0.435
## 100       1    110 141942  141942   0.284209                  0.435
## 101       1    110 141942  141942   0.270245                  0.435
## 102       1    110 141942  141942   0.258938                  0.435
## 103       1    110 141942  141942   0.303156                  0.435
## 104       1    110 141942  141942   0.285365                  0.435
## 105       1    110 141942  141942   0.271196                  0.435
## 106       1    110 141942  141942   0.259750                  0.435
## 107       1    110 141942  141942   0.250134                  0.435
## 108       1    110 141942  141942   0.241725                  0.435
## 109       1    110 141942  141942   0.252136                  0.435
## 110       1    110 141942  141942   0.243488                  0.435
## 111       1    110 141942  141942   0.255715                  0.435
## 112       1    110 141942  141942   0.290004                  0.435
## 113       1    110 141942  141942   0.288547                  0.435
## 114       1    110 141942  141942   0.292368                  0.435
## 115       1    110 141942  141942   0.290821                  0.435
## 116       1    110 141942  141942   0.289228                  0.435
## 117       1    110 141942  141942   0.287602                  0.435
## 118       1    110 141942  141942   0.286132                  0.435
## 119       1    110 141942  141942   0.284822                  0.435
## 120       1    110 141942  141942   0.391623                  0.435
## 121       1    110 141942  141942   0.379168                  0.435
## 122       1    110 141942  141942   0.368886                  0.435
## 123       1    110 141942  141942   0.360502                  0.435
## 124       1    110 141942  141942   0.353691                  0.435
## 125       1    110 141942  141942   0.347598                  0.435
## 126       1    110 141942  141942   0.342498                  0.435
## 127       1    110 141942  141942   0.347324                  0.435
## 128       1    110 141942  141942   0.409766                  0.435
## 129       1    110 141942  141942   0.421909                  0.435
## 130       1    110 141942  141942   0.399401                  0.435
## 131       1    110 141942  141942   0.408288                  0.435
## 132       1    110 141942  141942   0.390523                  0.435
## 133       1    110 141942  141942   0.377861                  0.435
## 134       1    110 141942  141942   0.368069                  0.435
## 135       1    110 141942  141942   0.359892                  0.435
## 136       1    110 141942  141942   0.352940                  0.435
## 137       1    110 141942  141942   0.347033                  0.435
## 138       1    110 141942  141942   0.341761                  0.435
## 139       1    110 141942  141942   0.336981                  0.435
## 140       1    110 141942  141942   0.333063                  0.435
## 141       1    110 141942  141942   0.334094                  0.435
## 142       1    110 141942  141942   0.361331                  0.435
## 143       1    110 141942  141942   0.362795                  0.435
## 144       1    110 141942  141942   0.356568                  0.435
## 145       1    110 141942  141942   0.351655                  0.435
## 146       1    110 141942  141942   0.345942                  0.435
## 147       1    110 141942  141942   0.340851                  0.435
## 148       1    110 141942  141942   0.336253                  0.435
## 149       1    110 141942  141942   0.332093                  0.435
## 150       1    110 141942  141942   0.347373                  0.435
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.113007   0.104324  0.10432388
## 2                  0.113007   0.104916  0.10491635
## 3                  0.113007   0.101704  0.10170387
## 4                  0.113007   0.126956  0.12695562
## 5                  0.113007   0.120263  0.12026271
## 6                  0.113007   0.124680  0.12467970
## 7                  0.113007   0.141879  0.14187873
## 8                  0.113007   0.131651  0.13165057
## 9                  0.113007   0.123983  0.12398283
## 10                 0.113007   0.117866  0.11786629
## 11                 0.113007   0.112917  0.11291687
## 12                 0.113007   0.108755  0.10875522
## 13                 0.113007   0.105114  0.10511384
## 14                 0.113007   0.101887  0.10188744
## 15                 0.113007   0.099000  0.09900035
## 16                 0.113007   0.096395  0.09639469
## 17                 0.113007   0.094026  0.09402612
## 18                 0.113007   0.091860  0.09185982
## 19                 0.113007   0.089867  0.08986665
## 20                 0.113007   0.088025  0.08802486
## 21                 0.113007   0.086315  0.08631531
## 22                 0.113007   0.084723  0.08472234
## 23                 0.113007   0.085695  0.08569544
## 24                 0.113007   0.084144  0.08414379
## 25                 0.113007   0.086613  0.08661328
## 26                 0.113007   0.151105  0.15110464
## 27                 0.113007   0.173222  0.17322178
## 28                 0.113007   0.150292  0.15029163
## 29                 0.113007   0.137518  0.13751742
## 30                 0.113007   0.128505  0.12850552
## 31                 0.113007   0.128736  0.12873651
## 32                 0.113007   0.121732  0.12173171
## 33                 0.113007   0.116051  0.11605148
## 34                 0.113007   0.111398  0.11139741
## 35                 0.113007   0.107451  0.10745066
## 36                 0.113007   0.108128  0.10812838
## 37                 0.113007   0.129209  0.12920892
## 38                 0.113007   0.129112  0.12911191
## 39                 0.113007   0.122040  0.12204012
## 40                 0.113007   0.116314  0.11631421
## 41                 0.113007   0.111628  0.11162796
## 42                 0.113007   0.123104  0.12310456
## 43                 0.113007   0.143797  0.14379708
## 44                 0.113007   0.133104  0.13310435
## 45                 0.113007   0.125175  0.12517560
## 46                 0.113007   0.118889  0.11888898
## 47                 0.113007   0.121187  0.12118708
## 48                 0.113007   0.115617  0.11561734
## 49                 0.113007   0.111039  0.11103897
## 50                 0.113007   0.139068  0.13906776
## 51                 0.113007   0.129695  0.12969438
## 52                 0.113007   0.130729  0.13072924
## 53                 0.113007   0.166013  0.16601297
## 54                 0.113007   0.146918  0.14691777
## 55                 0.113007   0.135303  0.13530284
## 56                 0.113007   0.187129  0.18712873
## 57                 0.113007   0.113007  0.11300691
## 58                 0.113007   0.122139  0.12213930
## 59                 0.113007   0.124383  0.12438303
## 60                 0.113007   0.118235  0.11823561
## 61                 0.113007   0.124451  0.12445089
## 62                 0.113007   0.118278  0.11827780
## 63                 0.113007   0.128384  0.12838416
## 64                 0.113007   0.130061  0.13006108
## 65                 0.113007   0.130903  0.13090325
## 66                 0.113007   0.132487  0.13248708
## 67                 0.113007   0.160273  0.16027314
## 68                 0.113007   0.143634  0.14363396
## 69                 0.113007   0.132909  0.13290903
## 70                 0.113007   0.132464  0.13246402
## 71                 0.113007   0.139740  0.13973984
## 72                 0.113007   0.141818  0.14181783
## 73                 0.113007   0.131597  0.13159751
## 74                 0.113007   0.154810  0.15480997
## 75                 0.113007   0.175130  0.17512970
## 76                 0.113007   0.150970  0.15096979
## 77                 0.113007   0.137871  0.13787107
## 78                 0.113007   0.128696  0.12869649
## 79                 0.113007   0.121638  0.12163775
## 80                 0.113007   0.136087  0.13608671
## 81                 0.113007   0.136279  0.13627854
## 82                 0.113007   0.127497  0.12749763
## 83                 0.113007   0.120678  0.12067770
## 84                 0.113007   0.115121  0.11512101
## 85                 0.113007   0.117287  0.11728644
## 86                 0.113007   0.125973  0.12597252
## 87                 0.113007   0.119451  0.11945143
## 88                 0.113007   0.114099  0.11409963
## 89                 0.113007   0.109684  0.10968395
## 90                 0.113007   0.105914  0.10591380
## 91                 0.113007   0.112615  0.11261541
## 92                 0.113007   0.108475  0.10847552
## 93                 0.113007   0.121550  0.12155031
## 94                 0.113007   0.128091  0.12809097
## 95                 0.113007   0.121150  0.12115011
## 96                 0.113007   0.115513  0.11551294
## 97                 0.113007   0.115629  0.11562909
## 98                 0.113007   0.126590  0.12658979
## 99                 0.113007   0.131233  0.13123341
## 100                0.113007   0.123631  0.12363091
## 101                0.113007   0.117556  0.11755658
## 102                0.113007   0.112638  0.11263803
## 103                0.113007   0.131873  0.13187286
## 104                0.113007   0.124134  0.12413377
## 105                0.113007   0.117970  0.11797026
## 106                0.113007   0.112991  0.11299125
## 107                0.113007   0.108808  0.10880829
## 108                0.113007   0.105150  0.10515038
## 109                0.113007   0.109679  0.10967916
## 110                0.113007   0.105917  0.10591728
## 111                0.113007   0.111236  0.11123603
## 112                0.113007   0.126152  0.12615174
## 113                0.113007   0.125518  0.12551794
## 114                0.113007   0.127180  0.12718008
## 115                0.113007   0.126507  0.12650713
## 116                0.113007   0.125814  0.12581418
## 117                0.113007   0.125107  0.12510687
## 118                0.113007   0.124468  0.12446742
## 119                0.113007   0.123898  0.12389757
## 120                0.113007   0.170356  0.17035601
## 121                0.113007   0.164938  0.16493808
## 122                0.113007   0.160465  0.16046541
## 123                0.113007   0.156818  0.15681837
## 124                0.113007   0.153856  0.15385558
## 125                0.113007   0.151205  0.15120513
## 126                0.113007   0.148987  0.14898663
## 127                0.113007   0.151086  0.15108594
## 128                0.113007   0.178248  0.17824821
## 129                0.113007   0.183530  0.18353042
## 130                0.113007   0.173739  0.17373943
## 131                0.113007   0.177605  0.17760528
## 132                0.113007   0.169877  0.16987751
## 133                0.113007   0.164369  0.16436954
## 134                0.113007   0.160110  0.16011001
## 135                0.113007   0.156553  0.15655302
## 136                0.113007   0.153529  0.15352890
## 137                0.113007   0.150959  0.15095935
## 138                0.113007   0.148666  0.14866604
## 139                0.113007   0.146587  0.14658673
## 140                0.113007   0.144882  0.14488240
## 141                0.113007   0.145331  0.14533089
## 142                0.113007   0.157179  0.15717898
## 143                0.113007   0.157816  0.15781582
## 144                0.113007   0.155107  0.15510708
## 145                0.113007   0.152970  0.15296993
## 146                0.113007   0.150485  0.15048477
## 147                0.113007   0.148270  0.14827018
## 148                0.113007   0.146270  0.14627006
## 149                0.113007   0.144460  0.14446046
## 150                0.113007   0.151107  0.15110725
validationsmNSElistsite2<- c()
validationsmlnNSElistsite2<- c()
validationsmKGElistsite2<- c()


#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site2"))))))
  validationsmKGElistsite2[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


 validationsmKGElistsite2
## [[1]]
## [1] 0.4864673
## 
## [[2]]
## [1] 0.33976
## 
## [[3]]
## [1] 0.5247815
## 
## [[4]]
## [1] 0.1714399
## 
## [[5]]
## [1] 0.08595064
## 
## [[6]]
## [1] 0.4987404

prepare to run model 20 times for patch 3 - only for validation time series

run model in parallel

read 20 runs, create table and append to table for site 3

setwd(system.file("extdata/", package = "RHESSysIOinR"))

# Read in RHESSys Validation runs

for(i in 1:validationruns) { 
  temp_dataset<- read.csv(paste0("outputfilter/valws32patch3_",i,".csv"))
  temp_dataset$date<- as.Date(paste(temp_dataset$year, temp_dataset$month, temp_dataset$day, sep = "-"), format = "%Y-%m-%d")
  temp_dataset$rootzonevwc<- temp_dataset$rootzone.S*temp_dataset$rootzone.potential_sat 
  assign(paste0("cwws32valssurgo3_run",i),temp_dataset)
}


##merge calibration runs with observed so dates match up, instead of subsetting 

for(i in 1:validationruns) { assign(paste0("valmergesm",i), merge(obsws32smvalclean,eval(parse(text = paste0("cwws32valssurgo3_run",i))), by.x = "Date", by.y="date", all = FALSE))
  assign(paste0("valsubsetsm",i),eval(parse(text = paste0("valmergesm",i)))[eval(parse(text = paste0("valmergesm",i,"$date"))) >= Valdates[1] & eval(parse(text = paste0("valmergesm",i,"$date"))) <= Valdates[2], ])}


validationsmNSElistsite3<- c()
validationsmlnNSElistsite3<- c()
validationsmKGElistsite3<- c()

#for(i in 1:n) {  assign(paste0("vsmNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture"))))))
#  valsmNSElist[[i]]<- eval(parse(text = paste0("vsmNSEobs",i))) }

#for(i in 1:n) {  assign(paste0("vsmlnNSEobs",i), NSE(sim = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$rz_storage","/valsubsetsm",i,"$rootdepth")))), obs = as.numeric(eval(parse(text = paste0("valsubsetsm",i,"$mergedsoilmoisture")))), FUN = log, epsilon = "Pushpalatha2012", na.rm=TRUE))
#  valsmlnNSElist[[i]]<- eval(parse(text = paste0("vsmlnNSEobs",i))) }

for(i in 1:validationruns) {  assign(paste0("vsmKGEobs",i), KGE(sim = as.numeric(eval(parse(text = paste0("valmergesm",i,"$rootzonevwc")))), obs = as.numeric(eval(parse(text = paste0("valmergesm",i,"$Site3"))))))
  validationsmKGElistsite3[[i]]<- eval(parse(text = paste0("vsmKGEobs",i))) }


validationsmKGElistsite3
## [[1]]
## [1] -0.5608392
## 
## [[2]]
## [1] 0.04529827
## 
## [[3]]
## [1] -0.5146413
## 
## [[4]]
## [1] -0.3874426
## 
## [[5]]
## [1] -0.0427253
## 
## [[6]]
## [1] -0.3909819
valmergesm2
##           Date mergedsoilmoisture     Site3     Site2     Site1 day month year
## 1   2017-12-17          0.1812803 0.2184210 0.1298160 0.1827378  17    12 2017
## 2   2017-12-18          0.1813529 0.2184097 0.1318113 0.1814523  18    12 2017
## 3   2017-12-19          0.1786329 0.2147977 0.1310752 0.1781363  19    12 2017
## 4   2017-12-20          0.2045600 0.2352214 0.1611586 0.2064497  20    12 2017
## 5   2017-12-21          0.2121985 0.2435130 0.1689051 0.2133542  21    12 2017
## 6   2017-12-22          0.2034018 0.2369948 0.1599421 0.2024036  22    12 2017
## 7   2017-12-23          0.2159135 0.2474115 0.1737037 0.2160729  23    12 2017
## 8   2017-12-24          0.2180366 0.2508741 0.1779583 0.2152578  24    12 2017
## 9   2017-12-25          0.2051297 0.2392457 0.1649375 0.2011580  25    12 2017
## 10  2017-12-26          0.1967778 0.2311780 0.1564815 0.1925998  26    12 2017
## 11  2017-12-27          0.1907229 0.2253247 0.1504178 0.1863498  27    12 2017
## 12  2017-12-28          0.1860186 0.2206840 0.1457465 0.1815573  28    12 2017
## 13  2017-12-29          0.1822263 0.2169158 0.1421042 0.1776285  29    12 2017
## 14  2017-12-30          0.1789890 0.2136771 0.1389468 0.1743325  30    12 2017
## 15  2017-12-31          0.1760297 0.2104852 0.1361690 0.1714696  31    12 2017
## 16  2018-01-01          0.1730221 0.2068863 0.1335336 0.1687743   1     1 2018
## 17  2018-01-02          0.1699094 0.2026606 0.1310185 0.1663264   2     1 2018
## 18  2018-01-03          0.1674965 0.1998021 0.1287234 0.1642708   3     1 2018
## 19  2018-01-04          0.1650735 0.1969184 0.1264468 0.1621988   4     1 2018
## 20  2018-01-05          0.1623993 0.1935668 0.1236840 0.1602682   5     1 2018
## 21  2018-01-06          0.1599766 0.1904905 0.1211806 0.1585599   6     1 2018
## 22  2018-01-07          0.1576960 0.1877726 0.1186574 0.1568984   7     1 2018
## 23  2018-01-08          0.1568914 0.1872422 0.1174618 0.1561128   8     1 2018
## 24  2018-01-09          0.1574485 0.1894384 0.1169259 0.1558507   9     1 2018
## 25  2018-01-10          0.1592184 0.1939688 0.1176424 0.1556502  10     1 2018
## 26  2018-01-11          0.2106263 0.2476406 0.1661053 0.2070026  11     1 2018
## 27  2018-01-12          0.2585713 0.3023993 0.2126192 0.2492075  12     1 2018
## 28  2018-01-13          0.2298163 0.2697049 0.1885231 0.2208976  13     1 2018
## 29  2018-01-14          0.2101749 0.2461050 0.1714329 0.2033012  14     1 2018
## 30  2018-01-15          0.2000193 0.2340321 0.1618090 0.1946641  15     1 2018
## 31  2018-01-16          0.1934378 0.2271962 0.1552234 0.1883403  16     1 2018
## 32  2018-01-17          0.1884672 0.2222873 0.1504387 0.1831684  17     1 2018
## 33  2018-01-18          0.1847465 0.2177543 0.1464155 0.1804870  18     1 2018
## 34  2018-01-19          0.1827311 0.2160347 0.1430255 0.1792066  19     1 2018
## 35  2018-01-20          0.1806938 0.2148377 0.1400914 0.1770017  20     1 2018
## 36  2018-01-21          0.1788930 0.2141354 0.1381655 0.1741962  21     1 2018
## 37  2018-01-22          0.1816379 0.2176727 0.1396944 0.1770608  22     1 2018
## 38  2018-01-23          0.2099719 0.2426632 0.1698900 0.2073420  23     1 2018
## 39  2018-01-24          0.2042055 0.2377882 0.1643600 0.2005069  24     1 2018
## 40  2018-01-25          0.1978362 0.2319010 0.1582002 0.1934983  25     1 2018
## 41  2018-01-26          0.1925960 0.2267535 0.1530544 0.1880946  26     1 2018
## 42  2018-01-27          0.1913684 0.2261970 0.1498113 0.1877075  27     1 2018
## 43  2018-01-28          0.2227986 0.2548967 0.1778299 0.2244271  28     1 2018
## 44  2018-01-29          0.2251622 0.2590182 0.1841771 0.2220451  29     1 2018
## 45  2018-01-30          0.2114195 0.2458255 0.1703889 0.2077865  30     1 2018
## 46  2018-01-31          0.2024122 0.2366563 0.1618900 0.1985599  31     1 2018
## 47  2018-02-01          0.1966335 0.2307604 0.1560451 0.1929479   1     2 2018
## 48  2018-02-02          0.1958087 0.2303811 0.1535116 0.1929592   2     2 2018
## 49  2018-02-03          0.1918223 0.2255894 0.1503773 0.1891389   3     2 2018
## 50  2018-02-04          0.2215597 0.2586415 0.1716586 0.2219036   4     2 2018
## 51  2018-02-05          0.2242181 0.2588863 0.1816354 0.2214870   5     2 2018
## 52  2018-02-06          0.2119706 0.2460191 0.1716088 0.2081936   6     2 2018
## 53  2018-02-07          0.2403602 0.2747222 0.1988044 0.2371649   7     2 2018
## 54  2018-02-08          0.2277506 0.2657526 0.1858970 0.2211389   8     2 2018
## 55  2018-02-09          0.2117093 0.2479861 0.1712176 0.2058012   9     2 2018
## 56  2018-02-10          0.2263567 0.2620903 0.1832708 0.2229375  10     2 2018
## 57  2018-02-11          0.2594152        NA 0.2386782 0.2749679  11     2 2018
## 58  2018-02-12          0.2177703        NA 0.1980856 0.2325339  12     2 2018
## 59  2018-02-13          0.2526821 0.3420382 0.1811157 0.2170009  13     2 2018
## 60  2018-02-14          0.2187074 0.2685182 0.1701852 0.2052882  14     2 2018
## 61  2018-02-15          0.2141866 0.2565538 0.1676806 0.2066988  15     2 2018
## 62  2018-02-16          0.2078769 0.2455486 0.1646400 0.2026328  16     2 2018
## 63  2018-02-17          0.2023741 0.2391111 0.1590405 0.1981372  17     2 2018
## 64  2018-02-18          0.2103213 0.2463655 0.1647130 0.2084835  18     2 2018
## 65  2018-02-19          0.2066506 0.2421328 0.1613194 0.2051667  19     2 2018
## 66  2018-02-20          0.2011578 0.2357995 0.1573102 0.1994019  20     2 2018
## 67  2018-02-21          0.2304523 0.2652378 0.1867384 0.2284523  21     2 2018
## 68  2018-02-22          0.2259672 0.2614158 0.1850486 0.2212075  22     2 2018
## 69  2018-02-23          0.2114646 0.2466120 0.1711169 0.2065781  23     2 2018
## 70  2018-02-24          0.2029441 0.2381710 0.1622558 0.1982335  24     2 2018
## 71  2018-02-25          0.2018564 0.2393038 0.1585914 0.1968576  25     2 2018
## 72  2018-02-26          0.2042301 0.2415321 0.1595822 0.2004141  26     2 2018
## 73  2018-02-27          0.1995574 0.2352457 0.1563762 0.1962552  27     2 2018
## 74  2018-02-28          0.2057860 0.2428750 0.1602326 0.2028620  28     2 2018
## 75  2018-03-01          0.2489119 0.2840321 0.2047778 0.2468924   1     3 2018
## 76  2018-03-02          0.2292061 0.2686840 0.1862639 0.2219349   2     3 2018
## 77  2018-03-03          0.2128520 0.2514045 0.1705255 0.2060443   3     3 2018
## 78  2018-03-04          0.2033614 0.2409384 0.1614676 0.1972049   4     3 2018
## 79  2018-03-05          0.1965865 0.2332422 0.1551944 0.1909748   5     3 2018
## 80  2018-03-06          0.2052393 0.2435052 0.1590255 0.2016337   6     3 2018
## 81  2018-03-07          0.2119353 0.2464280 0.1661713 0.2117656   7     3 2018
## 82  2018-03-08          0.2067156 0.2389826 0.1597778 0.2096519   8     3 2018
## 83  2018-03-09          0.2004845 0.2327387 0.1543472 0.2028333   9     3 2018
## 84  2018-03-10          0.1957295 0.2281016 0.1500116 0.1976458  10     3 2018
## 85  2018-03-11          0.1919861 0.2243811 0.1463588 0.1938116  11     3 2018
## 86  2018-03-12          0.2025691 0.2368247 0.1501875 0.2075998  12     3 2018
## 87  2018-03-13          0.2017443 0.2339063 0.1517373 0.2070877  13     3 2018
## 88  2018-03-14          0.1974754 0.2298194 0.1485509 0.2018247  14     3 2018
## 89  2018-03-15          0.1936638 0.2264358 0.1453831 0.1971024  15     3 2018
## 90  2018-03-16          0.1900477 0.2228429 0.1423264 0.1930434  16     3 2018
## 91  2018-03-17          0.1877393 0.2206745 0.1395810 0.1909227  17     3 2018
## 92  2018-03-18          0.1905354 0.2259635 0.1386458 0.1940243  18     3 2018
## 93  2018-03-19          0.1901329 0.2256233 0.1380532 0.1937023  19     3 2018
## 94  2018-03-20          0.2072206 0.2431823 0.1490359 0.2148976  20     3 2018
## 95  2018-03-21          0.2128883 0.2453212 0.1578299 0.2217491  21     3 2018
## 96  2018-03-22          0.2075410 0.2405356 0.1544282 0.2143811  22     3 2018
## 97  2018-03-23          0.2024549 0.2355833 0.1507025 0.2081406  23     3 2018
## 98  2018-03-24          0.1993210 0.2326936 0.1475405 0.2047839  24     3 2018
## 99  2018-03-25          0.2166313 0.2498394 0.1597975 0.2260486  25     3 2018
## 100 2018-03-26          0.2121376 0.2440990 0.1599988 0.2192804  26     3 2018
## 101 2018-03-27          0.2056414 0.2378082 0.1552662 0.2112561  27     3 2018
## 102 2018-03-28          0.2002648 0.2323446 0.1511817 0.2049974  28     3 2018
## 103 2018-03-29          0.2006057 0.2330764 0.1502801 0.2058793  29     3 2018
## 104 2018-03-30          0.2255177 0.2530920 0.1760208 0.2350660  30     3 2018
## 105 2018-03-31          0.2150303 0.2447335 0.1675706 0.2209219  31     3 2018
## 106 2018-04-01          0.2069646 0.2373377 0.1602535 0.2116250   1     4 2018
## 107 2018-04-02          0.2005587 0.2311814 0.1541250 0.2047613   2     4 2018
## 108 2018-04-03          0.1953756 0.2262899 0.1490255 0.1992240   3     4 2018
## 109 2018-04-04          0.1962923 0.2295095 0.1461979 0.2006458   4     4 2018
## 110 2018-04-05          0.1934653 0.2269696 0.1437060 0.1972804   5     4 2018
## 111 2018-04-06          0.1907393 0.2251259 0.1406759 0.1939002   6     4 2018
## 112 2018-04-07          0.2162749 0.2500877 0.1606632 0.2241710   7     4 2018
## 113 2018-04-08          0.2142361 0.2459740 0.1637072 0.2203950   8     4 2018
## 114 2018-04-09          0.2083649 0.2414036 0.1575637 0.2134271   9     4 2018
## 115 2018-04-10          0.2035641 0.2366189 0.1536088 0.2079757  10     4 2018
## 116 2018-04-11          0.1985177 0.2312960 0.1493970 0.2025799  11     4 2018
## 117 2018-04-12          0.1938879 0.2266094 0.1450822 0.1977708  12     4 2018
## 118 2018-04-13          0.1897607 0.2225330 0.1410868 0.1934939  13     4 2018
## 119 2018-04-14          0.1861888 0.2190686 0.1376424 0.1897188  14     4 2018
## 120 2018-04-15          0.2267652 0.2573394 0.1796586 0.2315208  15     4 2018
## 121 2018-04-16          0.2352825 0.2709479 0.1876516 0.2353403  16     4 2018
## 122 2018-04-17          0.2187042 0.2539436 0.1719479 0.2185321  17     4 2018
## 123 2018-04-18          0.2088741 0.2433733 0.1627118 0.2089965  18     4 2018
## 124 2018-04-19          0.2016534 0.2354809 0.1558704 0.2021632  19     4 2018
## 125 2018-04-20          0.1961351 0.2297092 0.1502894 0.1969453  20     4 2018
## 126 2018-04-21          0.1915013 0.2250877 0.1454896 0.1924236  21     4 2018
## 127 2018-04-22          0.1883138 0.2221033 0.1417083 0.1894783  22     4 2018
## 128 2018-04-23          0.2570006 0.2928273 0.2113310 0.2554262  23     4 2018
## 129 2018-04-24          0.2662503 0.3156189 0.2124942 0.2571988  24     4 2018
## 130 2018-04-25          0.2356152 0.2778342 0.1868507 0.2299696  25     4 2018
## 131 2018-04-26          0.2246237 0.2655755 0.1754988 0.2205156  26     4 2018
## 132 2018-04-27          0.2251174 0.2625469 0.1765451 0.2241172  27     4 2018
## 133 2018-04-28          0.2142165 0.2513707 0.1661273 0.2131293  28     4 2018
## 134 2018-04-29          0.2061856 0.2437292 0.1575150 0.2051450  29     4 2018
## 135 2018-04-30          0.1998873 0.2375208 0.1509155 0.1989826  30     4 2018
## 136 2018-05-01          0.1946701 0.2322135 0.1456887 0.1938628   1     5 2018
## 137 2018-05-02          0.1905331 0.2286172 0.1412465 0.1894141   2     5 2018
## 138 2018-05-03          0.1862787 0.2238941 0.1374086 0.1853160   3     5 2018
## 139 2018-05-04          0.1821768 0.2190781 0.1339653 0.1814340   4     5 2018
## 140 2018-05-05          0.1787459 0.2156814 0.1309086 0.1776884   5     5 2018
## 141 2018-05-06          0.1771430 0.2143819 0.1283380 0.1765078   6     5 2018
## 142 2018-05-07          0.1816304 0.2184427 0.1335903 0.1808481   7     5 2018
## 143 2018-05-08          0.1969321 0.2361970 0.1438322 0.1974922   8     5 2018
## 144 2018-05-09          0.1949738 0.2357708 0.1394086 0.1958507   9     5 2018
## 145 2018-05-10          0.1898592 0.2300799 0.1351667 0.1906580  10     5 2018
## 146 2018-05-11          0.1844252 0.2234852 0.1313345 0.1851832  11     5 2018
## 147 2018-05-12          0.1788747 0.2176962 0.1274792 0.1785998  12     5 2018
## 148 2018-05-13          0.1733239 0.2124896 0.1235127 0.1715165  13     5 2018
## 149 2018-05-14          0.1679975 0.2079583 0.1197731 0.1642049  14     5 2018
## 150 2018-05-15          0.1646196 0.2067674 0.1166227 0.1584696  15     5 2018
##     basinID hillID zoneID patchID rootzone.S rootzone.potential_sat
## 1         1    110 149478  149478   1.000000               0.181198
## 2         1    110 149478  149478   1.000000               0.181198
## 3         1    110 149478  149478   1.000000               0.181198
## 4         1    110 149478  149478   1.000000               0.181198
## 5         1    110 149478  149478   1.000000               0.181198
## 6         1    110 149478  149478   1.000000               0.181198
## 7         1    110 149478  149478   1.000000               0.181198
## 8         1    110 149478  149478   1.000000               0.181198
## 9         1    110 149478  149478   1.000000               0.181198
## 10        1    110 149478  149478   1.000000               0.181198
## 11        1    110 149478  149478   1.000000               0.181198
## 12        1    110 149478  149478   1.000000               0.181198
## 13        1    110 149478  149478   1.000000               0.181198
## 14        1    110 149478  149478   1.000000               0.181198
## 15        1    110 149478  149478   1.000000               0.181198
## 16        1    110 149478  149478   1.000000               0.181198
## 17        1    110 149478  149478   1.000000               0.181198
## 18        1    110 149478  149478   0.996242               0.181198
## 19        1    110 149478  149478   0.995624               0.181198
## 20        1    110 149478  149478   0.994047               0.181198
## 21        1    110 149478  149478   0.956242               0.181198
## 22        1    110 149478  149478   0.820668               0.181198
## 23        1    110 149478  149478   0.898985               0.181198
## 24        1    110 149478  149478   0.541534               0.181198
## 25        1    110 149478  149478   0.706985               0.181198
## 26        1    110 149478  149478   1.000000               0.181198
## 27        1    110 149478  149478   1.000000               0.181198
## 28        1    110 149478  149478   1.000000               0.181198
## 29        1    110 149478  149478   1.000000               0.181198
## 30        1    110 149478  149478   1.000000               0.181198
## 31        1    110 149478  149478   1.000000               0.181198
## 32        1    110 149478  149478   1.000000               0.181198
## 33        1    110 149478  149478   1.000000               0.181198
## 34        1    110 149478  149478   1.000000               0.181198
## 35        1    110 149478  149478   1.000000               0.181198
## 36        1    110 149478  149478   1.000000               0.181198
## 37        1    110 149478  149478   1.000000               0.181198
## 38        1    110 149478  149478   1.000000               0.181198
## 39        1    110 149478  149478   1.000000               0.181198
## 40        1    110 149478  149478   1.000000               0.181198
## 41        1    110 149478  149478   1.000000               0.181198
## 42        1    110 149478  149478   1.000000               0.181198
## 43        1    110 149478  149478   1.000000               0.181198
## 44        1    110 149478  149478   1.000000               0.181198
## 45        1    110 149478  149478   1.000000               0.181198
## 46        1    110 149478  149478   1.000000               0.181198
## 47        1    110 149478  149478   1.000000               0.181198
## 48        1    110 149478  149478   1.000000               0.181198
## 49        1    110 149478  149478   1.000000               0.181198
## 50        1    110 149478  149478   1.000000               0.181198
## 51        1    110 149478  149478   1.000000               0.181198
## 52        1    110 149478  149478   1.000000               0.181198
## 53        1    110 149478  149478   1.000000               0.181198
## 54        1    110 149478  149478   1.000000               0.181198
## 55        1    110 149478  149478   1.000000               0.181198
## 56        1    110 149478  149478   1.000000               0.181198
## 57        1    110 149478  149478   1.000000               0.181198
## 58        1    110 149478  149478   1.000000               0.181198
## 59        1    110 149478  149478   1.000000               0.181198
## 60        1    110 149478  149478   1.000000               0.181198
## 61        1    110 149478  149478   1.000000               0.181198
## 62        1    110 149478  149478   1.000000               0.181198
## 63        1    110 149478  149478   1.000000               0.181198
## 64        1    110 149478  149478   1.000000               0.181198
## 65        1    110 149478  149478   1.000000               0.181198
## 66        1    110 149478  149478   1.000000               0.181198
## 67        1    110 149478  149478   1.000000               0.181198
## 68        1    110 149478  149478   1.000000               0.181198
## 69        1    110 149478  149478   1.000000               0.181198
## 70        1    110 149478  149478   1.000000               0.181198
## 71        1    110 149478  149478   1.000000               0.181198
## 72        1    110 149478  149478   1.000000               0.181198
## 73        1    110 149478  149478   1.000000               0.181198
## 74        1    110 149478  149478   1.000000               0.181198
## 75        1    110 149478  149478   1.000000               0.181198
## 76        1    110 149478  149478   1.000000               0.181198
## 77        1    110 149478  149478   1.000000               0.181198
## 78        1    110 149478  149478   1.000000               0.181198
## 79        1    110 149478  149478   1.000000               0.181198
## 80        1    110 149478  149478   1.000000               0.181198
## 81        1    110 149478  149478   1.000000               0.181198
## 82        1    110 149478  149478   1.000000               0.181198
## 83        1    110 149478  149478   1.000000               0.181198
## 84        1    110 149478  149478   1.000000               0.181198
## 85        1    110 149478  149478   1.000000               0.181198
## 86        1    110 149478  149478   1.000000               0.181198
## 87        1    110 149478  149478   1.000000               0.181198
## 88        1    110 149478  149478   1.000000               0.181198
## 89        1    110 149478  149478   1.000000               0.181198
## 90        1    110 149478  149478   1.000000               0.181198
## 91        1    110 149478  149478   1.000000               0.181198
## 92        1    110 149478  149478   1.000000               0.181198
## 93        1    110 149478  149478   1.000000               0.181198
## 94        1    110 149478  149478   1.000000               0.181198
## 95        1    110 149478  149478   1.000000               0.181198
## 96        1    110 149478  149478   1.000000               0.181198
## 97        1    110 149478  149478   1.000000               0.181198
## 98        1    110 149478  149478   1.000000               0.181198
## 99        1    110 149478  149478   1.000000               0.181198
## 100       1    110 149478  149478   1.000000               0.181198
## 101       1    110 149478  149478   1.000000               0.181198
## 102       1    110 149478  149478   1.000000               0.181198
## 103       1    110 149478  149478   1.000000               0.181198
## 104       1    110 149478  149478   1.000000               0.181198
## 105       1    110 149478  149478   1.000000               0.181198
## 106       1    110 149478  149478   1.000000               0.181198
## 107       1    110 149478  149478   1.000000               0.181198
## 108       1    110 149478  149478   1.000000               0.181198
## 109       1    110 149478  149478   1.000000               0.181198
## 110       1    110 149478  149478   1.000000               0.181198
## 111       1    110 149478  149478   1.000000               0.181198
## 112       1    110 149478  149478   1.000000               0.181198
## 113       1    110 149478  149478   1.000000               0.181198
## 114       1    110 149478  149478   1.000000               0.181198
## 115       1    110 149478  149478   1.000000               0.181198
## 116       1    110 149478  149478   1.000000               0.181198
## 117       1    110 149478  149478   1.000000               0.181198
## 118       1    110 149478  149478   1.000000               0.181198
## 119       1    110 149478  149478   1.000000               0.181198
## 120       1    110 149478  149478   1.000000               0.181198
## 121       1    110 149478  149478   1.000000               0.181198
## 122       1    110 149478  149478   1.000000               0.181198
## 123       1    110 149478  149478   1.000000               0.181198
## 124       1    110 149478  149478   1.000000               0.181198
## 125       1    110 149478  149478   1.000000               0.181198
## 126       1    110 149478  149478   1.000000               0.181198
## 127       1    110 149478  149478   1.000000               0.181198
## 128       1    110 149478  149478   1.000000               0.181198
## 129       1    110 149478  149478   1.000000               0.181198
## 130       1    110 149478  149478   1.000000               0.181198
## 131       1    110 149478  149478   1.000000               0.181198
## 132       1    110 149478  149478   1.000000               0.181198
## 133       1    110 149478  149478   1.000000               0.181198
## 134       1    110 149478  149478   1.000000               0.181198
## 135       1    110 149478  149478   1.000000               0.181198
## 136       1    110 149478  149478   1.000000               0.181198
## 137       1    110 149478  149478   1.000000               0.181198
## 138       1    110 149478  149478   1.000000               0.181198
## 139       1    110 149478  149478   1.000000               0.181198
## 140       1    110 149478  149478   1.000000               0.181198
## 141       1    110 149478  149478   1.000000               0.181198
## 142       1    110 149478  149478   1.000000               0.181198
## 143       1    110 149478  149478   1.000000               0.181198
## 144       1    110 149478  149478   1.000000               0.181198
## 145       1    110 149478  149478   1.000000               0.181198
## 146       1    110 149478  149478   1.000000               0.181198
## 147       1    110 149478  149478   1.000000               0.181198
## 148       1    110 149478  149478   1.000000               0.181198
## 149       1    110 149478  149478   1.000000               0.181198
## 150       1    110 149478  149478   1.000000               0.181198
##     rootzone.field_capacity rz_storage rootzonevwc
## 1                  0.000000   0.000000  0.18119800
## 2                  0.000000   0.000000  0.18119800
## 3                  0.000000   0.000000  0.18119800
## 4                  0.000000   0.000000  0.18119800
## 5                  0.000000   0.000000  0.18119800
## 6                  0.000000   0.000000  0.18119800
## 7                  0.000000   0.000000  0.18119800
## 8                  0.000000   0.000000  0.18119800
## 9                  0.000000   0.000000  0.18119800
## 10                 0.000000   0.000000  0.18119800
## 11                 0.000000   0.000000  0.18119800
## 12                 0.000000   0.000000  0.18119800
## 13                 0.000000   0.000000  0.18119800
## 14                 0.000000   0.000000  0.18119800
## 15                 0.000000   0.000000  0.18119800
## 16                 0.000000   0.000000  0.18119800
## 17                 0.000000   0.000000  0.18119800
## 18                 0.000452   0.000310  0.18051706
## 19                 0.000361   0.000000  0.18040508
## 20                 0.000551   0.000130  0.18011933
## 21                 0.021751   0.027828  0.17326914
## 22                 0.036290   0.046961  0.14870340
## 23                 0.039521   0.062255  0.16289428
## 24                 0.049722   0.026065  0.09812488
## 25                 0.050881   0.058540  0.12810427
## 26                 0.000000   0.000000  0.18119800
## 27                 0.000000   0.000000  0.18119800
## 28                 0.000000   0.000000  0.18119800
## 29                 0.000000   0.000000  0.18119800
## 30                 0.000000   0.000000  0.18119800
## 31                 0.000000   0.000000  0.18119800
## 32                 0.000000   0.000000  0.18119800
## 33                 0.000000   0.000000  0.18119800
## 34                 0.000000   0.000000  0.18119800
## 35                 0.000000   0.000000  0.18119800
## 36                 0.000000   0.000000  0.18119800
## 37                 0.000000   0.000000  0.18119800
## 38                 0.000000   0.000000  0.18119800
## 39                 0.000000   0.000000  0.18119800
## 40                 0.000000   0.000000  0.18119800
## 41                 0.000000   0.000000  0.18119800
## 42                 0.000000   0.000000  0.18119800
## 43                 0.000000   0.000000  0.18119800
## 44                 0.000000   0.000000  0.18119800
## 45                 0.000000   0.000000  0.18119800
## 46                 0.000000   0.000000  0.18119800
## 47                 0.000000   0.000000  0.18119800
## 48                 0.000000   0.000000  0.18119800
## 49                 0.000000   0.000000  0.18119800
## 50                 0.000000   0.000000  0.18119800
## 51                 0.000000   0.000000  0.18119800
## 52                 0.000000   0.000000  0.18119800
## 53                 0.000000   0.000000  0.18119800
## 54                 0.000000   0.000000  0.18119800
## 55                 0.000000   0.000000  0.18119800
## 56                 0.000000   0.000000  0.18119800
## 57                 0.000000   0.000000  0.18119800
## 58                 0.000000   0.000000  0.18119800
## 59                 0.000000   0.000000  0.18119800
## 60                 0.000000   0.000000  0.18119800
## 61                 0.000000   0.000000  0.18119800
## 62                 0.000000   0.000000  0.18119800
## 63                 0.000000   0.000000  0.18119800
## 64                 0.000000   0.000000  0.18119800
## 65                 0.000000   0.000000  0.18119800
## 66                 0.000000   0.000000  0.18119800
## 67                 0.000000   0.000000  0.18119800
## 68                 0.000000   0.000000  0.18119800
## 69                 0.000000   0.000000  0.18119800
## 70                 0.000000   0.000000  0.18119800
## 71                 0.000000   0.000000  0.18119800
## 72                 0.000000   0.000000  0.18119800
## 73                 0.000000   0.000000  0.18119800
## 74                 0.000000   0.000000  0.18119800
## 75                 0.000000   0.000000  0.18119800
## 76                 0.000000   0.000000  0.18119800
## 77                 0.000000   0.000000  0.18119800
## 78                 0.000000   0.000000  0.18119800
## 79                 0.000000   0.000000  0.18119800
## 80                 0.000000   0.000000  0.18119800
## 81                 0.000000   0.000000  0.18119800
## 82                 0.000000   0.000000  0.18119800
## 83                 0.000000   0.000000  0.18119800
## 84                 0.000000   0.000000  0.18119800
## 85                 0.000000   0.000000  0.18119800
## 86                 0.000000   0.000000  0.18119800
## 87                 0.000000   0.000000  0.18119800
## 88                 0.000000   0.000000  0.18119800
## 89                 0.000000   0.000000  0.18119800
## 90                 0.000000   0.000000  0.18119800
## 91                 0.000000   0.000000  0.18119800
## 92                 0.000000   0.000000  0.18119800
## 93                 0.000000   0.000000  0.18119800
## 94                 0.000000   0.000000  0.18119800
## 95                 0.000000   0.000000  0.18119800
## 96                 0.000000   0.000000  0.18119800
## 97                 0.000000   0.000000  0.18119800
## 98                 0.000000   0.000000  0.18119800
## 99                 0.000000   0.000000  0.18119800
## 100                0.000000   0.000000  0.18119800
## 101                0.000000   0.000000  0.18119800
## 102                0.000000   0.000000  0.18119800
## 103                0.000000   0.000000  0.18119800
## 104                0.000000   0.000000  0.18119800
## 105                0.000000   0.000000  0.18119800
## 106                0.000000   0.000000  0.18119800
## 107                0.000000   0.000000  0.18119800
## 108                0.000000   0.000000  0.18119800
## 109                0.000000   0.000000  0.18119800
## 110                0.000000   0.000000  0.18119800
## 111                0.000000   0.000000  0.18119800
## 112                0.000000   0.000000  0.18119800
## 113                0.000000   0.000000  0.18119800
## 114                0.000000   0.000000  0.18119800
## 115                0.000000   0.000000  0.18119800
## 116                0.000000   0.000000  0.18119800
## 117                0.000000   0.000000  0.18119800
## 118                0.000000   0.000000  0.18119800
## 119                0.000000   0.000000  0.18119800
## 120                0.000000   0.000000  0.18119800
## 121                0.000000   0.000000  0.18119800
## 122                0.000000   0.000000  0.18119800
## 123                0.000000   0.000000  0.18119800
## 124                0.000000   0.000000  0.18119800
## 125                0.000000   0.000000  0.18119800
## 126                0.000000   0.000000  0.18119800
## 127                0.000000   0.000000  0.18119800
## 128                0.000000   0.000000  0.18119800
## 129                0.000000   0.000000  0.18119800
## 130                0.000000   0.000000  0.18119800
## 131                0.000000   0.000000  0.18119800
## 132                0.000000   0.000000  0.18119800
## 133                0.000000   0.000000  0.18119800
## 134                0.000000   0.000000  0.18119800
## 135                0.000000   0.000000  0.18119800
## 136                0.000000   0.000000  0.18119800
## 137                0.000000   0.000000  0.18119800
## 138                0.000000   0.000000  0.18119800
## 139                0.000000   0.000000  0.18119800
## 140                0.000000   0.000000  0.18119800
## 141                0.000000   0.000000  0.18119800
## 142                0.000000   0.000000  0.18119800
## 143                0.000000   0.000000  0.18119800
## 144                0.000000   0.000000  0.18119800
## 145                0.000000   0.000000  0.18119800
## 146                0.000000   0.000000  0.18119800
## 147                0.000000   0.000000  0.18119800
## 148                0.000000   0.000000  0.18119800
## 149                0.000000   0.000000  0.18119800
## 150                0.000000   0.000000  0.18119800

merge all 3 sites

setwd(system.file("extdata/", package = "RHESSysIOinR"))

threesitevalidation1<- data.frame(cbind(site1=as.numeric(validationsmKGElistsite1),site2=as.numeric(validationsmKGElistsite2),site3=as.numeric(validationsmKGElistsite3)))


threesitevalidation<-threesitevalidation1

threesitevalidation$allsites<- rowMeans(threesitevalidation1,na.rm=FALSE)

threesitevalidation
##        site1      site2       site3    allsites
## 1 -0.4129805 0.48646729 -0.56083919 -0.16245081
## 2 -0.3331869 0.33975996  0.04529827  0.01729044
## 3 -0.3865526 0.52478154 -0.51464132 -0.12547078
## 4 -0.2519766 0.17143992 -0.38744262 -0.15599308
## 5 -0.2582159 0.08595064 -0.04272530 -0.07166353
## 6 -0.3966292 0.49874045 -0.39098190 -0.09629020
boxplot(threesitevalidation1, main = "Boxplot of Patch Specific Root Zone Soil Moisture KGE - SSURGO")

boxplot(threesitevalidation, main = "Boxplot of Patch Specific Root Zone Soil Moisture KGE - SSURGO")

plot(validationsmKGElistsite1,validationsmKGElistsite3)

write.csv(threesitevalidation,'threesitevalidationssurgo.csv')

Group by group color by site plot kge on y axis plot group on x axis

setwd(system.file("extdata/", package = "RHESSysIOinR"))

ssurgovalidation<- read.csv("threesitevalidationssurgo.csv")
rssvalidation<- read.csv("threesitevalidationrss.csv")
staticvalidation<- read.csv("threesitevalidationstatic.csv")

staticvalidation$group <- 'Static'
rssvalidation$group <- 'RSS'
ssurgovalidation$group<- 'SSURGO'

combinedvalidation <- rbind(staticvalidation, rssvalidation, ssurgovalidation)


combinedvalidationlong1<- data.frame("KGE" = combinedvalidation$site1, "group" = combinedvalidation$group)
combinedvalidationlong2<- data.frame("KGE" = combinedvalidation$site2, "group" = combinedvalidation$group)
combinedvalidationlong3<- data.frame("KGE" = combinedvalidation$site3, "group" = combinedvalidation$group)
combinedvalidationlong4<- data.frame("KGE" = combinedvalidation$allsites, "group" = combinedvalidation$group)


combinedvalidationlong1$site = '1'
combinedvalidationlong2$site = '2'
combinedvalidationlong3$site = '3'
combinedvalidationlong4$site = 'All Sites'


combinedvalidationlong<- rbind(combinedvalidationlong1,combinedvalidationlong2, combinedvalidationlong3, combinedvalidationlong4)

combinedvalidationlong
##             KGE  group      site
## 1   0.460012844 Static         1
## 2  -0.186871845 Static         1
## 3   0.140115845 Static         1
## 4   0.017286278 Static         1
## 5  -0.714844974 Static         1
## 6  -0.718698207 Static         1
## 7  -0.157272838    RSS         1
## 8   0.009899872    RSS         1
## 9  -0.149258136    RSS         1
## 10 -0.050589156    RSS         1
## 11 -0.060160453    RSS         1
## 12 -0.261547943    RSS         1
## 13 -0.412980536 SSURGO         1
## 14 -0.333186916 SSURGO         1
## 15 -0.386552555 SSURGO         1
## 16 -0.251976552 SSURGO         1
## 17 -0.258215913 SSURGO         1
## 18 -0.396629156 SSURGO         1
## 19  0.462072325 Static         2
## 20 -0.052884645 Static         2
## 21  0.147161575 Static         2
## 22  0.025569804 Static         2
## 23 -0.463457910 Static         2
## 24 -0.494145661 Static         2
## 25  0.483862573    RSS         2
## 26  0.114362547    RSS         2
## 27  0.517419917    RSS         2
## 28  0.176843482    RSS         2
## 29  0.093780661    RSS         2
## 30  0.499025643    RSS         2
## 31  0.486467295 SSURGO         2
## 32  0.339759958 SSURGO         2
## 33  0.524781543 SSURGO         2
## 34  0.171439923 SSURGO         2
## 35  0.085950637 SSURGO         2
## 36  0.498740447 SSURGO         2
## 37 -0.617316659 Static         3
## 38           NA Static         3
## 39 -0.118521617 Static         3
## 40 -0.086468757 Static         3
## 41 -0.601611997 Static         3
## 42 -0.238116920 Static         3
## 43 -0.912928680    RSS         3
## 44           NA    RSS         3
## 45 -0.557277205    RSS         3
## 46 -0.850549066    RSS         3
## 47 -0.207118592    RSS         3
## 48 -0.084938917    RSS         3
## 49 -0.560839192 SSURGO         3
## 50  0.045298269 SSURGO         3
## 51 -0.514641320 SSURGO         3
## 52 -0.387442617 SSURGO         3
## 53 -0.042725304 SSURGO         3
## 54 -0.390981899 SSURGO         3
## 55  0.101589503 Static All Sites
## 56           NA Static All Sites
## 57  0.056251934 Static All Sites
## 58 -0.014537559 Static All Sites
## 59 -0.593304960 Static All Sites
## 60 -0.483653596 Static All Sites
## 61 -0.195446315    RSS All Sites
## 62           NA    RSS All Sites
## 63 -0.063038475    RSS All Sites
## 64 -0.241431580    RSS All Sites
## 65 -0.057832795    RSS All Sites
## 66  0.050846261    RSS All Sites
## 67 -0.162450811 SSURGO All Sites
## 68  0.017290437 SSURGO All Sites
## 69 -0.125470777 SSURGO All Sites
## 70 -0.155993082 SSURGO All Sites
## 71 -0.071663527 SSURGO All Sites
## 72 -0.096290203 SSURGO All Sites
#Remove NA values so that boxplot will work

validationnona<- subset(combinedvalidationlong,!is.na(combinedvalidationlong$KGE))


threesitevalidationplot <- ggplot(validationnona, aes(group, y = KGE, fill = site))+ geom_boxplot()+ ylab("Soil Moisture KGE - Validation") +xlab("Soil Map Input")+ ggtitle("Patch Specific Soil Moisture KGE For ALL Calibration Runs, NA Excluded")+geom_hline(yintercept=-0.41,linetype=2, col = 'RED')+ scale_y_continuous(breaks=seq(-6,1,1))+ theme_minimal()

threesitevalidationplot

validationnona
##             KGE  group      site
## 1   0.460012844 Static         1
## 2  -0.186871845 Static         1
## 3   0.140115845 Static         1
## 4   0.017286278 Static         1
## 5  -0.714844974 Static         1
## 6  -0.718698207 Static         1
## 7  -0.157272838    RSS         1
## 8   0.009899872    RSS         1
## 9  -0.149258136    RSS         1
## 10 -0.050589156    RSS         1
## 11 -0.060160453    RSS         1
## 12 -0.261547943    RSS         1
## 13 -0.412980536 SSURGO         1
## 14 -0.333186916 SSURGO         1
## 15 -0.386552555 SSURGO         1
## 16 -0.251976552 SSURGO         1
## 17 -0.258215913 SSURGO         1
## 18 -0.396629156 SSURGO         1
## 19  0.462072325 Static         2
## 20 -0.052884645 Static         2
## 21  0.147161575 Static         2
## 22  0.025569804 Static         2
## 23 -0.463457910 Static         2
## 24 -0.494145661 Static         2
## 25  0.483862573    RSS         2
## 26  0.114362547    RSS         2
## 27  0.517419917    RSS         2
## 28  0.176843482    RSS         2
## 29  0.093780661    RSS         2
## 30  0.499025643    RSS         2
## 31  0.486467295 SSURGO         2
## 32  0.339759958 SSURGO         2
## 33  0.524781543 SSURGO         2
## 34  0.171439923 SSURGO         2
## 35  0.085950637 SSURGO         2
## 36  0.498740447 SSURGO         2
## 37 -0.617316659 Static         3
## 39 -0.118521617 Static         3
## 40 -0.086468757 Static         3
## 41 -0.601611997 Static         3
## 42 -0.238116920 Static         3
## 43 -0.912928680    RSS         3
## 45 -0.557277205    RSS         3
## 46 -0.850549066    RSS         3
## 47 -0.207118592    RSS         3
## 48 -0.084938917    RSS         3
## 49 -0.560839192 SSURGO         3
## 50  0.045298269 SSURGO         3
## 51 -0.514641320 SSURGO         3
## 52 -0.387442617 SSURGO         3
## 53 -0.042725304 SSURGO         3
## 54 -0.390981899 SSURGO         3
## 55  0.101589503 Static All Sites
## 57  0.056251934 Static All Sites
## 58 -0.014537559 Static All Sites
## 59 -0.593304960 Static All Sites
## 60 -0.483653596 Static All Sites
## 61 -0.195446315    RSS All Sites
## 63 -0.063038475    RSS All Sites
## 64 -0.241431580    RSS All Sites
## 65 -0.057832795    RSS All Sites
## 66  0.050846261    RSS All Sites
## 67 -0.162450811 SSURGO All Sites
## 68  0.017290437 SSURGO All Sites
## 69 -0.125470777 SSURGO All Sites
## 70 -0.155993082 SSURGO All Sites
## 71 -0.071663527 SSURGO All Sites
## 72 -0.096290203 SSURGO All Sites